Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift: The Basics

Swift: The Basics

Marc Brown

June 17, 2014
Tweet

More Decks by Marc Brown

Other Decks in Programming

Transcript

  1. Swift vs. Objective-C Brooklyn Swift Developers Meetup Namespaces • Class

    names scoped to module (ie. framework) • No more class prefixes
  2. Swift vs. Objective-C Brooklyn Swift Developers Meetup Type Safety •

    Compiler performs type checks to find mismatched types • Allows for type inference var heyStr = “Hey”
  3. Swift vs. Objective-C Brooklyn Swift Developers Meetup Closures • Nameless

    function constructed as another function's argument • Equivalent to Blocks numbers.map({ (number: Int) -> Int in let result = 3 * number return result })
  4. Swift vs. Objective-C Brooklyn Swift Developers Meetup Tuples • Group

    multiple values to single value • Supports multiple types let someTuple = (10, true, “Hello”) // type (Int, Bool, String) let anotherTuple = (arg1: 100, arg2: “Hi”) // anotherTuple.arg1, anotherTuple.arg2
  5. Resources Brooklyn Swift Developers Meetup • The Swift Programming Language


    https://itunes.apple.com/us/book/swift-programming-language/ id881256329?mt=11 • WWDC 2014 Videos
 https://developer.apple.com/videos/wwdc/2014 • Ray Wenderlich Tutorials
 http://www.raywenderlich.com/tutorials • Swift Video Tutorials
 http://swiftvideotutorials.com