Comments (11)
@evgeniyd We'll be doing the migration in the open on branches and definitely won't turn down community help! 😄
from ios-oss.
Hi everyone! We've begun the Swift 3 migration, and it's doozy! We don't see a clear way of sharing this work, but if yer interested in following along or critiquing our methods, here are some PR's we've done so far:
kickstarter/Kickstarter-Prelude#62
kickstarter/Kickstarter-ReactiveExtensions#54
kickstarter/ios-ksapi#3
from ios-oss.
Hey everyone, we just completed our Swift 3 migration #26 so I'll close this one now. Thanks for the interest!
from ios-oss.
Great to hear that @evgeniyd
Like @damianesteban I'd love to help in this project!
from ios-oss.
Hey @mbrandonw I've migrated several ~900 class Swift projects to Swift 3 in the last month or so, (also the author of https://buildingvts.com/a-mostly-comprehensive-list-of-swift-3-0-and-2-3-changes-193b904bb5b1)
I'd like to share lessons learned doing these large migrations:
- If you use
@IBAction
, don't refactor your action code to look like:@IBAction func doTheThing(button: UIButton) { ... }
. Leave the anonymous first parameter in the method definition. - Push Notifications. If you were doing something like this to convert your device token to a string (I've seen this everywhere) your pushes are going to break:
return String(data: deviceToken.base64EncodedData(), encoding: .utf8)?
.trimmingCharacters(in: CharacterSet.whitespaces)
.trimmingCharacters(in: CharacterSet(charactersIn: "<>"))
?? ""
Realistically, the right way is to treat PN deviceTokens as Data
, but in lieu of that, here's some magic code to do it: return deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
- Networking (but really, value types).
AnyObject
used to be the gold standard for networking, and for any thing. That's been replaced byAny
, which is no longer a representation of a type but a representation of a value. Basically, things that areclass
objects areAnyObject
, butstruct
areAny
. This has far reaching implications. In general, you don't want to useAnyObject
unless you're communicating with an Obj-C class.
Finally, FREEZE THE WORLD. Conflicts here are neither trivial or fun. Don't spend time trying to deal with them.
from ios-oss.
Yeah for sure! It'll probably be the first thing we do in the new year. Stay tuned for the massive PR...
from ios-oss.
@mbrandonw so, will you be doing the migration in-house and without involving open-source community?
from ios-oss.
I would love to give a hand. This project is such an amazing resource.
from ios-oss.
Volunteering to help out over here 👋
from ios-oss.
@heshamsalman wow, thanks for all of the info! definitely the Any
/AnyObject
difference has definitely been the biggest gotcha we've experienced!
we just opened a PR that converts our Library.framework
to Swift 3 #26, which is more than half of the app code. Still a long ways to go, but we're making progress!
from ios-oss.
oh, and btw @heshamsalman, this is how we do our push token transformation: https://github.com/kickstarter/ios-oss/blob/master/Kickstarter-iOS/ViewModels/AppDelegateViewModel.swift#L629-L634. That's swift 2 code, hasn't been updated to swift 3 yet. i'll keep your comments in mind when i get to that code! thanks again!
from ios-oss.
Related Issues (20)
- no team account HOT 1
- Code that doesn't understand HOT 1
- No such Module 'Argo' HOT 1
- Not able to build project HOT 2
- Alamofire iOS: Unable to build HOT 3
- Question about architecture and bindings HOT 1
- Bootstrap fails because of Alamofire HOT 2
- Can't install apps as instructed. make bootstrap - Skipping secrets. HOT 6
- running "make bootstrap" it is failing with carthage: command not found HOT 1
- Lenses HOT 1
- xcframework HOT 2
- Are the storyboards not making problems when coding, refactoring and collaborating? HOT 1
- [Web] Validation failed: The identity verification process must be completed despite Green Status HOT 2
- ReactiveExtensions-TestHelpers-iOS build fail HOT 4
- make bootstrap throwing "Build Failed": ReactiveExtensions-iOS HOT 3
- Failed to read file or folder at /Users/administrator/ios-oss/Carthage/Build/iOS/FirebaseABTesting.framework
- [Idea] Remove `Screenshots` from repo HOT 1
- Open specific project page on Kickstarter app from another app using with CFBundleURLSchemes HOT 1
- RTL is not reversing direction when i pass UIView HOT 1
- run with runtime error 'Thread 1: "library must be initialized before calling this method."' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-oss.