Startup Swift

Startup Swift

From Try! Swift Tokyo 2017

79de7e7da4c75add758006a737dd5b50?s=128

Mo Kudeki

March 03, 2017
Tweet

Transcript

  1. STARTUP SWIFT MO @KUDEKI

  2. None
  3. EARLY 2016

  4. None
  5. MVP

  6. EMBRACE BEING A BEGINNER

  7. PARSE + SWIFT

  8. PARSE + SWIFT = FAST (TO WRITE)

  9. CONCISE UNINTIMIDATING

  10. PARSE + SWIFT = FAST (TO WRITE) (AND LOTS OF

    COCOAPODS)
  11. READY FOR SALE!

  12. None
  13. 100K

  14. 2 WEEKS

  15. None
  16. THINGS ARE BROKEN… FOR A WHILE

  17. REQUESTS / MIN

  18. None
  19. None
  20. None
  21. None
  22. let userName = user["firstName"] as! String

  23. if let userName = user.objectForKey("firstName”) { displayNameLabel.text = userName.uppercaseString }

  24. OPTIONALS

  25. GUARD

  26. SWITCH

  27. TYPES

  28. DON’T HAVE TO FIX BUGS THAT DON’T EXIST

  29. EXTENSIONS

  30. EACH NEW FEATURE BETTER THAN THE LAST

  31. SCRAPPING IT

  32. TIME TO MOVE OFF OF PARSE

  33. & SWIPES ON '

  34. NO API SEPARATION

  35. let report = PFObject(className:"Report") report["reporter"] = user report["reporteeUser"] = reportee

    report["reportText"] = text report.saveInBackgroundWithBlock { }
  36. SO NOW OUR WHOLE APP BECOMES…

  37. if parse { } else { }

  38. 1.⌘C ⌘V WHOLE FILES FacebookGraphRequest.swift ParseFacebookGraphRequest.swift

  39. 2.⌘C ⌘V FUNCTIONS func handleResponse() { } func handleResponseParse() {

    }
  40. 3. PROTOCOLS protocol LocationDisplayModel { // What we need to

    display the user's location in a view var neighborhood: String? { get set } var facebookLocation: String? { get set } var currentLocation: String? { get } var showNeighborhood: Bool { get set } . . . func toggleUseNeighborhood() }
  41. 3. PROTOCOLS

  42. 3. PROTOCOLS class UserLocation : LocationDisplayModel { … class ParseLocation

    : LocationDisplayModel { …
  43. TIME INVESTED = WORTH IT

  44. SELF DOCUMENTING

  45. DEPENDENCIES, SWIFT LANGUAGE CHANGES

  46. 6 MONTHS

  47. FAST TO LEARN

  48. CATCHES MISTAKES FOR YOU

  49. IMPROVE AS YOU GO

  50. FOCUS ON WHAT’S IMPORTANT