Giter VIP home page Giter VIP logo

Comments (11)

stephencelis avatar stephencelis commented on May 19, 2024 15

@evgeniyd We'll be doing the migration in the open on branches and definitely won't turn down community help! 😄

from ios-oss.

mbrandonw avatar mbrandonw commented on May 19, 2024 3

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.

mbrandonw avatar mbrandonw commented on May 19, 2024 2

Hey everyone, we just completed our Swift 3 migration #26 so I'll close this one now. Thanks for the interest!

from ios-oss.

jorgecasariego avatar jorgecasariego commented on May 19, 2024 1

Great to hear that @evgeniyd

Like @damianesteban I'd love to help in this project!

from ios-oss.

Iron-Ham avatar Iron-Ham commented on May 19, 2024 1

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 by Any, which is no longer a representation of a type but a representation of a value. Basically, things that are class objects are AnyObject, but struct are Any. This has far reaching implications. In general, you don't want to use AnyObject 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.

mbrandonw avatar mbrandonw commented on May 19, 2024

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.

evgeniyd avatar evgeniyd commented on May 19, 2024

@mbrandonw so, will you be doing the migration in-house and without involving open-source community?

from ios-oss.

damianesteban avatar damianesteban commented on May 19, 2024

I would love to give a hand. This project is such an amazing resource.

from ios-oss.

mfclarke avatar mfclarke commented on May 19, 2024

Volunteering to help out over here 👋

from ios-oss.

mbrandonw avatar mbrandonw commented on May 19, 2024

@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.

mbrandonw avatar mbrandonw commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.