I am need to convert a swift 2.3 project into swift 3.x. Around 12 frameworks are added to the project via Cocoapods. I just wanted to know best practices to follow for external libraries added via Pods.
Asked
Active
Viewed 120 times
-4
-
1I had about 4 libraries all installed via cocoopods, first step was to update the pods to swift 3, second step was let Xcode automatically convert the code, step 3 was to correct and fix issues arise from the conversion. Not sure that that's what you asked for, if it helped I will write an answer – inspector_60 Aug 26 '17 at 03:24
-
@inspector_60 Yes I was really confused where to start, Like which one should be done first , If you can share your steps it will be helpful for me. I am using Alamofire in the project and I could see it's syntax got changed drastically for Swift 3. Do you have any thoughts on that ? – Kannan Prasad Aug 26 '17 at 04:11
-
I think you just gotta fix the errors one by one. – Sweeper Aug 26 '17 at 06:34
1 Answers
0
I had about 4 libraries all installed via cocoopods. 0. Commit your correct branch (save your code before converting) 1. update your pods to swift 3. 2. let Xcode automatically convert the code. 3. correct and fix issues arise from the conversion (in your code), including API changes of the libraries(if made). - these will be mostly minor changes.
Note: One of the liberties I've changed was Alamofire. Note2: Don't be afraid, you can go back any time to your current position. Note3: If there are libraries that don't have a swift 3 version, you will have a problem to convert and basically you will have to do it manually and that's not recommended.

inspector_60
- 448
- 1
- 3
- 12