How to use edit> convert to convert objective C code to swift

I am trying to convert objective C code to swift code. There is a feature edit > convert which is supposed to do this. However, I cannot make it do anything at all.

There are no targets to convert found. How do I properly invoke this feature I must be doing something wrong.


Mark Schapira

I'm not sure it is intended to do automatic code conversion. That said, I could not find any documentation about it !

I don't think that menu does what you hope...


The choices being:

- current swift syntax

- modern Obj-C syntax

- Obj-C w/arc


There is no 'Obj-C to Swift' choice.


Quoting from Apple's Swift blog 10.2016:


Xcode 7 and OS X El Capitan

OS X El Capitan requires Xcode 7, which includes Swift 2, native support for System Integrity Protection (SIP), app thinning, as well as the latest SDKs. When running Xcode 7 you may notice a number of syntactical changes need to be applied to your Swift 1.2 code. To help in your migration to Swift 2, Xcode 7 includes a helpful tool to re-write older Swift code for you. Just select the menu item Edit > Convert > To Latest Swift Syntax and Xcode will migrate your code to the latest Swift API and syntax.

How to use edit> convert to convert objective C code to swift
 
 
Q