SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Tips for Migration from
Swift 2.2 to Swift 3.0
Swift 2.2 is no longer support
After Apple released XCode 8.2 in Sept 2016, swift project will need to force
upgrade to Swift 2.3 or Swift 3.0
Anyway, you still can upload ipa by using XCode 7, but not guarantee you can
pass Apple review approval.
Case Study
WalkingApp - written in swift 2.2
A bunch of third party library integrated including Objective-C, Swift and custom own library.
(Alamofire, SwiftFlux, Charts, XMPPFramework, SugarRecord, Realm, DeepLinkKit, SwaggerClient, etc.)
Big Project Size
Over ~1,000 swift code files
Slow compiling time in Swift
Average 20 mins for simulator debug build
40 mins ~ 50 mins for release build
It is terrible!
slow down development process seriously
OK. we are going to
upgrade the project next.
What happen if we click the “Convert” button?
Unlimited errors are
waiting for you to
fix!
Issue 1: Project settings error
Compile error about cocoapods library, legacy swift error
Fix: Add “SWIFT_VERSION” to Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Issue 2: Looping compiling error
Fix one red error introduce another error show in other place.
Some errors didn’t show up after compilation.
Fix: Tick “Continue building after errors”
Issue 3: XCode bug
XCode sometimes missing to display red error lines when you are fixing bug
Issue 4: 3rd party library support
“Alamofire” 4.x only support Swift 3 and does not support iOS8
“SwiftFlux” no update to support Swift 3 yet.
“Chart” totally change source code in Swift 3.
Fix: No fast solution at all
Firstly, you need to wait the source community to support Swift 3 before you start.
When you choose a 3rd party library, please pay attention to the active rate and number of stars.
Better mircoservice structures will help to debug and update for library code change.
Hint: Breakdown you big source code into many small library for specific feature.
Finally
We (4 Engineers) use about 1 month to update source code from Swift 2.2 to Swift 3.0 until the build is
success.
Summary
Use Objective-C if you afraid of fast change open source development process.
You still can use Objective-C in the future 3 years at least.
Swift language is good, but painful when upgrading from major version each time.
It will got much stable and easy coding and maintain.
Thanks!

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (10)

Swift3 generic
Swift3 genericSwift3 generic
Swift3 generic
 
iOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changesiOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changes
 
Swift 3
Swift   3Swift   3
Swift 3
 
Discover new music
Discover new musicDiscover new music
Discover new music
 
Latest fashion trends
Latest fashion trendsLatest fashion trends
Latest fashion trends
 
DOV-E TV Engage & Pay
DOV-E TV Engage & PayDOV-E TV Engage & Pay
DOV-E TV Engage & Pay
 
Anurag_Resume
Anurag_ResumeAnurag_Resume
Anurag_Resume
 
Las TIC y sus implicaciones educativas
 Las TIC y sus implicaciones educativas Las TIC y sus implicaciones educativas
Las TIC y sus implicaciones educativas
 
131111092-Forum5-PencarianHeuristik
131111092-Forum5-PencarianHeuristik131111092-Forum5-PencarianHeuristik
131111092-Forum5-PencarianHeuristik
 
MET presentation -2015
MET presentation -2015MET presentation -2015
MET presentation -2015
 

Ähnlich wie Tips for migration from swift 2.2 to swift 3.0

Eclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client RoundupEclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client Roundup
Murat Yener
 

Ähnlich wie Tips for migration from swift 2.2 to swift 3.0 (20)

Swift should I switch?
Swift should I switch?Swift should I switch?
Swift should I switch?
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Exploring App Compat
Exploring App CompatExploring App Compat
Exploring App Compat
 
Should you choose react native or swift for i os app development
Should you choose react native or swift for i os app development Should you choose react native or swift for i os app development
Should you choose react native or swift for i os app development
 
Alexander Kutsan: “C++ compilation boost”
Alexander Kutsan: “C++ compilation boost” Alexander Kutsan: “C++ compilation boost”
Alexander Kutsan: “C++ compilation boost”
 
Contributing To The Mozilla Codebase
Contributing To The Mozilla CodebaseContributing To The Mozilla Codebase
Contributing To The Mozilla Codebase
 
Programming in C++
Programming in C++Programming in C++
Programming in C++
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
Eclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client RoundupEclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client Roundup
 
An overview of the architecture of electron.js
An overview of the architecture of electron.jsAn overview of the architecture of electron.js
An overview of the architecture of electron.js
 
Api Versioning with Docker and Nginx
Api Versioning with Docker and NginxApi Versioning with Docker and Nginx
Api Versioning with Docker and Nginx
 
Xcode 6 release_notes
Xcode 6 release_notesXcode 6 release_notes
Xcode 6 release_notes
 
Programming
ProgrammingProgramming
Programming
 
iOS Development Using Swift 2
iOS Development Using Swift 2iOS Development Using Swift 2
iOS Development Using Swift 2
 
Reasons to Choose Swift for iOS App Development.pdf
Reasons to Choose Swift for iOS App Development.pdfReasons to Choose Swift for iOS App Development.pdf
Reasons to Choose Swift for iOS App Development.pdf
 
Srgoc java
Srgoc javaSrgoc java
Srgoc java
 
outgoing again
outgoing againoutgoing again
outgoing again
 
Top 10 IDEs for React.js Developers in 2021
Top 10 IDEs for React.js Developers in 2021Top 10 IDEs for React.js Developers in 2021
Top 10 IDEs for React.js Developers in 2021
 
Enterprise ipad Development with notes
Enterprise ipad Development with notesEnterprise ipad Development with notes
Enterprise ipad Development with notes
 
Java Programming Basics
Java Programming BasicsJava Programming Basics
Java Programming Basics
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Tips for migration from swift 2.2 to swift 3.0

  • 1. Tips for Migration from Swift 2.2 to Swift 3.0
  • 2. Swift 2.2 is no longer support After Apple released XCode 8.2 in Sept 2016, swift project will need to force upgrade to Swift 2.3 or Swift 3.0 Anyway, you still can upload ipa by using XCode 7, but not guarantee you can pass Apple review approval.
  • 4. WalkingApp - written in swift 2.2 A bunch of third party library integrated including Objective-C, Swift and custom own library. (Alamofire, SwiftFlux, Charts, XMPPFramework, SugarRecord, Realm, DeepLinkKit, SwaggerClient, etc.)
  • 5. Big Project Size Over ~1,000 swift code files
  • 6. Slow compiling time in Swift Average 20 mins for simulator debug build 40 mins ~ 50 mins for release build
  • 7. It is terrible! slow down development process seriously
  • 8. OK. we are going to upgrade the project next.
  • 9. What happen if we click the “Convert” button?
  • 10. Unlimited errors are waiting for you to fix!
  • 11. Issue 1: Project settings error Compile error about cocoapods library, legacy swift error
  • 12. Fix: Add “SWIFT_VERSION” to Podfile post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end
  • 13. Issue 2: Looping compiling error Fix one red error introduce another error show in other place. Some errors didn’t show up after compilation.
  • 14. Fix: Tick “Continue building after errors”
  • 15. Issue 3: XCode bug XCode sometimes missing to display red error lines when you are fixing bug
  • 16. Issue 4: 3rd party library support “Alamofire” 4.x only support Swift 3 and does not support iOS8 “SwiftFlux” no update to support Swift 3 yet. “Chart” totally change source code in Swift 3.
  • 17. Fix: No fast solution at all Firstly, you need to wait the source community to support Swift 3 before you start. When you choose a 3rd party library, please pay attention to the active rate and number of stars. Better mircoservice structures will help to debug and update for library code change. Hint: Breakdown you big source code into many small library for specific feature.
  • 18. Finally We (4 Engineers) use about 1 month to update source code from Swift 2.2 to Swift 3.0 until the build is success.
  • 19. Summary Use Objective-C if you afraid of fast change open source development process. You still can use Objective-C in the future 3 years at least. Swift language is good, but painful when upgrading from major version each time. It will got much stable and easy coding and maintain.