Join Simon Allardice for an in-depth discussion in this video Migrating from Objective-C to Swift, part of Comparing Swift and Objective-C.
- If you have an existing Objective-C project…and you want to migrate the entire thing over to Swift,…well first you should have a reason other…than just changing the code base.…If it ain't broke don't fix it,…there should be a compelling reason to be going…through this process.…Perhaps to add new functionality or new features,…to revisit and refine your algorithms or architecture…but something other than just changing the language…for the sake of it.…Let's say we want to go ahead and do this…but you might be wondering if there is an option…in Xcode to help us migrate an entire project…from Obejctive-C to Swift, and there isn't.…
There is no convert Objective-C to Swift option…anywhere in Xcode I'm afraid.…Migration is a manual process,…we don't really convert anything,…we just need to rewrite it all in Swift.…Because whatever we might think of as a migration…from Objective-C to Swift is going to start…as a mix and match.…You're gonna take a project that's all Objective-C…and gradually switch pieces of it over to Swift…
Need a refresher on either language? Check out Swift Essential Training and Objective-C Essential Training.
- Exploring the interoperability of Swift and Objective-C
- Comparing language syntax
- Understanding how each language uses objects and methods
- Bridging arrays, dictionaries, and numbers
- Dealing with nil return types from Objective-C methods
- Working with NSError in Swift
- Working with Swift and Objective-C strings
- Adding Swift to an existing Objective-C project
- Inheriting between languages