swift 2.3 to swift 3.0
I have a project that was started using swift 2 in xcode 7. I am now using swift 2.3 in xcode 8. When I try to migrate to pro 3 I get several errors no project. Both from the libraries and from my code. First I update my pods and then do an automatic conversion of the project. My doubts are:
In case some library can give rise to error I can unlock it and convert?
Do I have to prepare something before starting the conversation? In the articles I read about it, I did not say anything else about it.
In case you continue using swift 2.3 will you have any future problems?
The application is very large, what would be the best option?
- How to add Label in BWWalkthrough View Controller with Swift 3?
- UI Tests - isSelected is always returning false
- How to decode string using NSSecureCoding in Swift 3?
- Check if on correct dispatch queue in Swift 3
- Distinction between private and fileprivate top-level classes
- ISO8601DateFormatter doesn't parse ISO date string
Solutions Collect From Internet About “swift 2.3 to swift 3.0”
Honestly? Any project built with Swift since 2014 should be done with an understanding of code will break with every new version through Swift 3.X. (I’m not at all being critical, just practical.) This year, Swift 4.X is working hard to not break Swift 3.X code.
So with that starting point, here’s my thoughts:
- 1 Take a backup of a working Swift 2.X app and archive it. Backup that backup.
- 2 Accept the price that should have been known when using any version before 3.X – the conversion will be painful and time-consuming.
- 3 Wherever possible, do not use third party add ins. They can add to the complexity of migrating to the latest version.
- 4 Do consider waiting for Swift 4. I’m not recommending this at all, but saying consider the big picture. But always remember eventually you will have to port things. (The good news is Swift 3 appears stable enough to say future upgrade will not be (at least) as painful.
- 5 Consider migrating everything at once. (If you have that golden backup duplicated in several places, that makes it easier.) Yes, there are ways to migrate individual project, files, etc. from 2.X to 3.X – and 4.X (along with what is likely Xcode 9) makes things easier going forward. But only if you are starting from 3.X.
- 6 Regards to Swift 2.3… the latest version of Xcode will not compile/build Swift 2.3. Take that as a sign – someday it will no longer be accepted in the App Store. That day may be 2-3 years away (or not), but It’s almost 2 years since the promises of ABI and version compatibility were meant for Swift 3.0. BTW, only the latter happened.
Welcome to the world of a very fast evolving language!
EDIT: Regards to point #3 (avoid third party add ins where possible), I found two links expressing the issues that can come up:
Analyzing Third Party Libraries
Avoiding Third Party UI Libraries
- TableView with multiple prototype cells
- Get unicode character by glyph index in a CTFontRef or CGFontRef object
- Core Data Deletion rules and many-to-many relationships
- Swift: How to get substring from start to last index of character
- What is an easy way to break an NSArray with 4000+ objects in it into multiple arrays with 30 objects each?
- Is it possible to write a parental control app for iOS?
- iOS7 NSMergeConflict on Single Thread Save
- Do I have to register a new Bundle ID to upload new application to iTune Connect?
- How to get only images in the camera roll using Photos Framework
- How did Whatsapp app removed app's compatibility for iPad?
- Xcode malloc error
- Need complete Data protection while Core Data processing is in background
- NSTextAttachment Image Disappears When Attributes Are Set
- UIButtons at the bottom of UIScrollView not working
- iOS 8 push notification action buttons – code in handleActionWithIdentifier does not always run when app is in background