Build Once Use Everywhere

Build Once Use Everywhere

Reuse your code across platforms in order to build apps for all of Apple's App Stores!

This talk was given at UIKonf 2016.

9f63c98d741c8130adb71db3bbf77f08?s=128

Dasmer

May 23, 2016
Tweet

Transcript

  1. 2.
  2. 7.
  3. 9.

    MOST APPS ARE WRITTEN ON IOS > 2.3 million iOS

    Apps 1 > 10,000+ Apple Watch apps2 > 1,000+ Apple TV apps3 > 30,000 Mac Apps1 1 (May 2016) Appshopper 3 (Nov 2015) DigitalTrends 2 (Sept 2015) TechCrunch
  4. 11.

    WRITING APPS FOR OTHER PLATFORMS IS PROBABLY MUCH EASIER THAN

    YOU THINK... 1. You already know Swift 2. You already know many core frameworks
  5. 12.

    COMMONLY USED IOS FRAMEWORKS ALREADY ON TVOS > UIKit >

    Foundation > Core Location > CoreData > MapKit > SpriteKit > AVFoundation > Core Media > Media Player > Many, many more
  6. 13.

    COMMONLY USED IOS FRAMEWORKS ALREADY ON WATCHOS > Foundation >

    Core Motion > Core Location > CoreData > HealthKit > HomeKit > PassKit > Contacts
  7. 14.

    COMMONLY USED IOS FRAMEWORKS ALREADY ON OS X > Foundation

    > CoreData > Contacts > AddressBook
  8. 16.

    SHARING CODE 1. Reduces redundancy 2. Avoids duplicate tests and

    documentation 3. Makes your code more modular
  9. 18.

    STEPS 1. Write an API Wrapper Framework -> GiltKit 2.

    Create a new target and add the appropriate OS specific UI logic for each OS 3. Add GiltKit to each target and use it to display a list of upcoming sales.
  10. 19.

    GILTKIT HEADER PREVIEW public struct Client { public init(session: NSURLSession

    = default) public func listSalesForStore(store: GiltKit.Store, kind: GiltKit.Sale.Kind, completion: (([GiltKit.Sale]) -> ())) } public struct Sale { public enum Kind : String { case Upcoming case Active } public let name: String public let description: String public let imageURL: NSURL public let size: UInt public let store: GiltKit.Store } public enum Store : String { case Men case Women case Kids case Home }
  11. 20.