Paul Miard - Objective-C U L8R: A Swift Transition

Paul Miard - Objective-C U L8R: A Swift Transition

As a mobile agency, Prolific Interactive builds and maintains many apps at once. Since the introduction of Swift 2, they've launched 5 greenfield projects entirely in Swift, integrated it into the rest of their legacy code, and launched several open source projects. In this talk, Paul Miard will be showing off what they've learned about bringing a team up to speed, getting stakeholders on board, and writing production-quality code in a brand new language.

Recording from the March 2016 Brooklyn Swift Developers Meetup: http://meetup.com/Brooklyn-Swift-Developers/events/231125444/

Video: https://www.youtube.com/watch?v=ifO-zPg-j3A

Transcript

  1. Objective-C U L8R Prolific’s Swift Shift Paul Miard - Lead

    iOS Engineer May 25th, 2016
  2. Talk Overview • Why did we switch? • How did

    we switch? • Should you switch?
  3. None
  4. Why did we switch?

  5. None
  6. Transition process

  7. Swift 2.0 introduced Deadline: read Swift books Deadline: code test

    due Start first all-Swift project End of 3-phase code test review All projects have Sw ift! Present Swift Style Guide June 2015 July 2015 August 2015 September 2015 November 2015 End of 2015 February 2016
  8. Swift 2.0 introduced Deadline: read Sw ift books Deadline: code

    test due Start first all-Swift project End of 3-phase code test review All projects have Sw ift! Present Swift Style Guide June 2015 July 2015 August 2015 September 2015 November 2015 End of 2015 February 2016
  9. Swift 2.0 introduced Deadline: read Swift books Deadline: code test

    due Start first all-Swift project End of 3-phase code test review All projects have Sw ift! Present Swift Style Guide June 2015 July 2015 August 2015 September 2015 November 2015 End of 2015 February 2016
  10. Swift 2.0 introduced Deadline: read Swift books Deadline: code test

    due Start first all-Sw ift project End of 3-phase code test review All projects have Sw ift! Present Swift Style Guide June 2015 July 2015 August 2015 September 2015 November 2015 End of 2015 February 2016
  11. Swift 2.0 introduced Deadline: read Swift books Deadline: code test

    due Start first all-Swift project End of 3-phase code test review All projects have Sw ift! Present Swift Style Guide June 2015 July 2015 August 2015 September 2015 November 2015 End of 2015 February 2016
  12. Swift Style Guide github.com/prolificinteractive/swift-style-guide

  13. Swift at Prolific today

  14. In Production
 2015–2016

  15. Currently at Prolific ⅓ of All Code in Swift Measured

    in Lines of Code
  16. How Comfortable P’s Feel Writing Swift Self-reported. 1 = “Can’t

    write FizzBuzz,” 5 = “Literally Chris Lattner”
  17. Difficulties

  18. Difficulties: Dependencies

  19. Difficulties: Learning Curve

  20. “How do I even do a for loop?” — Chris

    Jones Senior iOS Engineer
  21. Learning curve • Natural learners • Learning speed • Mentorship

    • Jump in!
  22. Difficulties: Xcode

  23. So, should you write Swift?

  24. So, should you write Swift on a new project?

  25. So, should you write Swift on a new project? YES!

  26. Swift on a new project • Performance • Development speed

    • Safety — less bugs • Future-proof
  27. “Without Swift, the app would have been harder to build

    in four weeks… The increased power Swift gave us was more than enough to compensate for the time the learning curve took away.” — Thibault Klein
  28. Average LoC per file

  29. “We're learning something new so let's just go all- in

    with new things.” — Chris Jones
  30. New architectures • Language features promote alternative paradigms to OOP

    • Syntax makes functional style more readable • Writing in a new language makes you question old habits MVVM VIPER CLEAN
  31. on a legacy project? So, should you write Swift

  32. So, should you write Swift on a legacy project? …yes?

  33. Swift on a legacy project • Optionals, type system will

    all help you • Can’t use advanced, Swift- only features • At the end, you’ll still have a lot of NSObjects
  34. “Modernizing the project is very important. You can't live on

    Objective-C forever, at some point Apple is going to kill you.” — John Lin
  35. Swift integration strategies • Integrate vertically • Start with the

    lowest level • Refactor as you go
  36. • Switch if you can • The hardest part of

    switching to Swift is the learning curve • For a brand new project, it’ll be worth the effort — development is much faster • For a legacy project, it can still be worth it to learn and get some of the benefits Takeaways
  37. None
  38. Check out our blog! • Objective-C U L8TR - A

    Swift Transition • Communication in Code: Engineering Standards for Growing Teams • People-Focused Engineering Culture A few process oriented posts
  39. Prolific open-source Swift • Swift Style Guide - a Style

    Guide for Swift. • Caishen - a Payment Card UI & Validator for iOS. • Simcoe - a simple, light analytics framework for iOS. • Yoshi - an in-app debug panel for iOS. • Marker - a light wrapper around NSAttributedString. • Optik - a library for displaying images from any source, local or remote. • Cake - a Cocoapods wrapper allowing for greater control over your workspaces • Gloss - a JSON parsing library written by a Prolific P!
  40. More Prolific talks!? • Advanced Topics in Swift & Objective-C

    Generics • Chris Jones, Senior iOS Engineer at Prolific Interactive • June 13th, 2016 @Google We can also get technical :)
  41. • Objective-C U L8TR - A Swift Transition • This

    very presentation! • More Prolific videos • Our Youtube channel We make videos (this slide was added later :)
  42. Thank you. Brooklyn 45 Main St, Suite 1006 Brooklyn, NY

    11201 347.462.0990 San Francisco 995 Market St, 14th Floor San Francisco, CA 94103 415.813.4199
  43. Questions?