SlideShare a Scribd company logo
Hidden Gems
in Swift
@akashivskyy
Agenda
‣ Literal Convertibles
‣ String Interpolation
‣ Pattern Matching
‣ Reflection
‣ Objective-C Bridging
Literal
Convertibles
Literal convertibles
struct RegularExpression {
let pattern: String
init(pattern: String)
}
let emailRegex = RegularExpression(
pattern: "^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$"
)
// would be nice
let emailRegex = "^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$"
1.0
String literal convertible
extension RegularExpression: StringLiteralConvertible {
typealias StringLiteralType = String
init(stringLiteral value: StringLiteralType) {
self.pattern = value
}
}
extension RegularExpression: ExtendedGraphemeClusterLiteralConvertible
extension RegularExpression: UnicodeScalarLiteralConvertible
1.0
All kinds of literals
‣ Array – Array, ArraySlice, Set
‣ Boolean – Bool, ObjCBool
‣ Dictionary – Dictionary, DictionaryLiteral
‣ Float – Float, Double
‣ Nil – Optional, Selector, Pointer
‣ Integer – Int, UInt, Float, Double
‣ String – String, Character, Selector
String
Interpolation
String interpolation
enum Byte: UInt8 {
case Zero = 0
case One = 1
}
let string = "(Byte.Zero)" // "Byte.Zero"
// would be nice
let string = "(Byte.Zero)" // "0"
1.0
Interpolation convertible
extension String /* : StringInterpolationConvertible */ {
init(stringInterpolationSegment byte: Byte) {
self = "(byte.rawValue)"
}
}
let string = "(Byte.Zero)" // "0"
1.0
Pattern

Matching
What are patterns?
‣ Enumeration cases
‣ Single equatable values
‣ Ranges and intervals
‣ Value bindings
‣ Type casts
‣ func ~= <T, U> (lhs: T, rhs: U) -> Bool
‣ Tuples of anything above
Hidden Gems in Swift
What are patterns?
‣ Enumeration cases
‣ Single equatable values
‣ Ranges and intervals
‣ Value bindings
‣ Type casts
‣ func ~= <T, U> (lhs: T, rhs: U) -> Bool
‣ Tuples of anything above
Where do we use them?
‣ Switch statements
‣ If-let bindings
‣ For-in loops
‣ Catch statements
case
let point = (1, 2)
switch point {
case (0, 0):
println("origin")
default:
println("arbitrary point")
}
1.0
case let where
let point = (3, 4)
switch point {
case let (x, y) where x == y:
println("point on x = y line")
default:
println("arbitrary point")
}
1.0
if let where
let point: (Int, Int)? = maybePoint()
if let (_, y) = point where y > 0 {
println("point above x axis")
}
1.2
for in where
let points = [
(1, 2),
(-3, 4),
(5, -6),
(-7, -8),
(9, 10)
]
for (x, y) in points where x > 0 && y > 0 {
println("point in 1st quadrant: ((x), (y))")
}
1.2
if case
let point = (5, 6)
let (width, height) = (
Int(UIScreen.mainScreen().bounds.width),
Int(UIScreen.mainScreen().bounds.height)
)
if case (0 ... width, 0 ... height) = point {
print("point on screen")
}
2.0
if case let where
let point = (7, 8)
if case let (x, 1 ..< Int.max) = point where x < 0 {
print("point in 2nd quadrant")
}
2.0
if case let where
switch subject {
case pattern where condition:
// becomes
if case pattern = subject where condition {
// multiple cases not yet supported
if case pattern1, pattern2 = subject { // compiler error
2.0
for case let in where
let points: [(Int, Int)?] = maybePoints()
for case .Some(let (x, y)) in points where x < 0 && y < 0 {
print("point in 3rd quadrant: ((x), (y))")
}
2.0
for case let in where
for element in subject {
if case pattern = element where condition {
// becomes
for case pattern in subject where condition {
// multiple cases not yet supported
for case pattern1, pattern2 in subject { // compiler error
2.0
Reflection
Default behavior
struct Vector {
typealias Point = (x: Double, y: Double)
let start: Point
let end: Point
var length: Double {
return sqrt(pow(end.x - start.x, 2) + pow(end.y - start.y, 2))
}
}
let unitVector = Vector(start: (0, 0), end: (1, 1))
2.0
Default behavior 2.0
(.0 0, .1 0)
(.0 1, .1 1)
Reflection methods
‣ Custom description
‣ Custom children tree
‣ Custom Quick Look preview
Custom description
extension Vector: CustomStringConvertible {
var description: String {
return "((start.x) × (start.y)) → ((end.x) × (end.y))"
}
}
2.0
Custom description 2.0
"(0.0 × 0.0) → (1.0 × 1.0)"
Custom mirror
extension Vector: CustomReflectable {
func customMirror() -> Mirror {
return Mirror(self, children: [
"start": "(start.x) × (start.y)",
"end": "(end.x) × (end.y)",
"length": length
])
}
}
2.0
Custom mirror 2.0
start "0.0 × 0.0"
end "1.0 × 1.0"
length 1.414213562373095
Custom preview
extension Vector: CustomPlaygroundQuickLookable {
func customPlaygroundQuickLook() -> PlaygroundQuickLook {
var bezierPath = UIBezierPath()
// draw the path
return .BezierPath(bezierPath)
}
}
2.0
Custom preview 2.0
Reflection principles
‣ Overrides default type descriptors
‣ Provides rich visualization
‣ Read-only
Objective-C
Bridging
Available bridging methods
‣ Inherit from Objective-C classes
‣ @objc attribute
‣ Bridging headers
‣ …and that’s basically it
Or is it?
@interface NSArray<Element> : NSObject // objective-c class
@end
struct Array<Element> { // generic swift struct
}
let swiftArray: [Int]
let objcArray = swiftArray as NSArray // no problem
2.0
Or is it?
@interface NSArray : NSObject
@end
struct Array<Element>: _ObjectiveCBridgeable {
}
let swiftArray: [Int]
let objcArray = swiftArray as NSArray
2.0
Bridgeable
protocol _ObjectiveCBridgeable {
typealias _ObjectiveCType
static func _isBridgedToObjectiveC() -> Bool
static func _getObjectiveCType() -> Any.Type
func _bridgeToObjectiveC() -> _ObjectiveCType
static func _forceBridgeFromObjectiveC(...)
static func _conditionallyBridgeFromObjectiveC(...)
}
2.0
Bridgeable
@interface XYZPoint : NSObject
- (instancetype)initWithX:(double)x y:(double)y;
@property double x;
@property double y;
@end
struct Point {
let x: Double
let y: Double
}
2.0
extension Point: _ObjectiveCBridgeable {
typealias _ObjectiveCType = XYZPoint
static func _isBridgedToObjectiveC() -> Bool {
return true
}
static func _getObjectiveCType() -> Any.Type {
return _ObjectiveCType.self
}
func _bridgeToObjectiveC() -> _ObjectiveCType {
return XYZPoint(x: x, y: y)
}
static func _forceBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Point?) {
result = Point(x: source.x, y: source.y)
}
static func _conditionallyBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Point?) -> Bool {
_forceBridgeFromObjectiveC(source, result: &result)
return true
}
}
2.0
Bridgeable
let objcPoint = XYZPoint(x: 1, y: 2)
if let swiftPoint = objcPoint as? Point {
// that's right
}
let objcPoint = XYZPoint(x: 3, y: 4)
let swiftPoint = objcPoint as Point // yeah
let swiftPoint = Point(x: 5, y: 6)
let objcPoint = swiftPoint as XYZPoint // hell yeah
let point: XYZPoint = Point(x: 7, y: 8) // mind: blown
2.0
Recap
‣ Literal Convertibles
‣ String Interpolation
‣ Pattern Matching
‣ Reflection
‣ Objective-C Bridging
How to learn the gems
‣ Carefully read Xcode release notes
‣ Follow right people on Twitter
‣ Study Swift module interface
‣ Use LLDB type lookup
‣ Experiment in playgrounds
Questions?
@akashivskyy
github.com/akashivskyy/talks
Thanks! 🍻
@akashivskyy
github.com/akashivskyy/talks

More Related Content

PDF
Swift for TensorFlow - CoreML Personalization
PDF
Java script obfuscation
PPTX
Groovy grails types, operators, objects
PPTX
Pre zen ta sion
PDF
How to Create a l10n Payroll Structure
PDF
C++ L09-Classes Part2
PPTX
Scala best practices
PPTX
Category theory, Monads, and Duality in the world of (BIG) Data
Swift for TensorFlow - CoreML Personalization
Java script obfuscation
Groovy grails types, operators, objects
Pre zen ta sion
How to Create a l10n Payroll Structure
C++ L09-Classes Part2
Scala best practices
Category theory, Monads, and Duality in the world of (BIG) Data

What's hot (20)

PDF
Developer Experience i TypeScript. Najbardziej ikoniczne duo
PDF
Model-Driven Software Development - Static Analysis & Error Checking
PDF
C++ L11-Polymorphism
PDF
Variables, expressions, standard types
PDF
RESTful API using scalaz (3)
DOC
Oops lab manual2
PDF
Swift で JavaScript 始めませんか? #iOSDC
PPTX
Chapter 7 functions (c)
PPSX
DIWE - Working with MySQL Databases
PDF
C++ L08-Classes Part1
PPT
Collection v3
PDF
7 Habits For a More Functional Swift
PDF
Standford 2015 week9
PPTX
Type Driven Development with TypeScript
PDF
Let the type system be your friend
PDF
Bind me if you can
PDF
Standford 2015 week3: Objective-C Compatibility, Property List, Views
PDF
Dynamic C++ ACCU 2013
KEY
Objective-Cひとめぐり
PDF
Property-based testing
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Model-Driven Software Development - Static Analysis & Error Checking
C++ L11-Polymorphism
Variables, expressions, standard types
RESTful API using scalaz (3)
Oops lab manual2
Swift で JavaScript 始めませんか? #iOSDC
Chapter 7 functions (c)
DIWE - Working with MySQL Databases
C++ L08-Classes Part1
Collection v3
7 Habits For a More Functional Swift
Standford 2015 week9
Type Driven Development with TypeScript
Let the type system be your friend
Bind me if you can
Standford 2015 week3: Objective-C Compatibility, Property List, Views
Dynamic C++ ACCU 2013
Objective-Cひとめぐり
Property-based testing
Ad

Viewers also liked (8)

PPTX
Strategia w Social Media w 6 krokach
PDF
KISS Augmented Reality
PDF
Why Would A Programmer Fall In Love With SPA?
PDF
Payments integration: Stripe & Taxamo
PPT
Blogi w firmie
PDF
Czy Project Manger Musi Być Osobą Techniczną?
PDF
301 Adam Zygadlewicz
PDF
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Strategia w Social Media w 6 krokach
KISS Augmented Reality
Why Would A Programmer Fall In Love With SPA?
Payments integration: Stripe & Taxamo
Blogi w firmie
Czy Project Manger Musi Być Osobą Techniczną?
301 Adam Zygadlewicz
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Ad

Similar to Hidden Gems in Swift (20)

PDF
Funcitonal Swift Conference: The Functional Way
PDF
To Swift 2...and Beyond!
PDF
Introduction to Swift 2
PDF
Denis Lebedev, Swift
PDF
Swift core
PDF
A swift introduction to Swift
PDF
Pooya Khaloo Presentation on IWMC 2015
PDF
Programming Language Swift Overview
PDF
Deep Dive Into Swift
PDF
From android/java to swift (3)
PPT
Swift: Apple's New Programming Language for iOS and OS X
PDF
Cocoa Design Patterns in Swift
PDF
Fighting history of CGFloat in Swift
PDF
視覚化とSwiftのタイプについて
PDF
Introduction to Swift programming language.
PDF
What make Swift Awesome
PDF
An introduction to functional programming with Swift
PDF
Real World Generics In Swift
PDF
Swift Programming
PDF
Swift Introduction
Funcitonal Swift Conference: The Functional Way
To Swift 2...and Beyond!
Introduction to Swift 2
Denis Lebedev, Swift
Swift core
A swift introduction to Swift
Pooya Khaloo Presentation on IWMC 2015
Programming Language Swift Overview
Deep Dive Into Swift
From android/java to swift (3)
Swift: Apple's New Programming Language for iOS and OS X
Cocoa Design Patterns in Swift
Fighting history of CGFloat in Swift
視覚化とSwiftのタイプについて
Introduction to Swift programming language.
What make Swift Awesome
An introduction to functional programming with Swift
Real World Generics In Swift
Swift Programming
Swift Introduction

More from Netguru (20)

PDF
Defining DSL (Domain Specific Language) using Ruby
PDF
How To Build Great Relationships With Your Clients
PDF
Agile Retrospectives
PDF
Ruby Rails Overview
PDF
From Birds To Bugs: Testowanie Z Pasją
PDF
Communication With Clients Throughout The Project
PDF
Everyday Rails
PDF
Estimation myths debunked
PDF
Programming Paradigms Which One Is The Best?
PDF
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
PDF
Paradygmaty Programowania: Czy Istnieje Najlepszy?
PDF
CSS architecture: How To Write Clean & Scalable Code
PDF
Ruby On Rails Intro
PDF
Perfect Project Read Me (in a few steps)
PDF
The Git Basics
PDF
From nil to guru: intro to Ruby on Rails
PDF
Working With Teams Across The Borders
PDF
Front-End Dev Tools
PDF
OOScss Architecture For Rails Apps
KEY
Coffeescript presentation DublinJS
Defining DSL (Domain Specific Language) using Ruby
How To Build Great Relationships With Your Clients
Agile Retrospectives
Ruby Rails Overview
From Birds To Bugs: Testowanie Z Pasją
Communication With Clients Throughout The Project
Everyday Rails
Estimation myths debunked
Programming Paradigms Which One Is The Best?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Paradygmaty Programowania: Czy Istnieje Najlepszy?
CSS architecture: How To Write Clean & Scalable Code
Ruby On Rails Intro
Perfect Project Read Me (in a few steps)
The Git Basics
From nil to guru: intro to Ruby on Rails
Working With Teams Across The Borders
Front-End Dev Tools
OOScss Architecture For Rails Apps
Coffeescript presentation DublinJS

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
history of c programming in notes for students .pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
AI in Product Development-omnex systems
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
System and Network Administraation Chapter 3
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
ai tools demonstartion for schools and inter college
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
history of c programming in notes for students .pptx
Nekopoi APK 2025 free lastest update
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
CHAPTER 2 - PM Management and IT Context
AI in Product Development-omnex systems
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Softaken Excel to vCard Converter Software.pdf
System and Network Administraation Chapter 3
ManageIQ - Sprint 268 Review - Slide Deck
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administration Chapter 2
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Odoo POS Development Services by CandidRoot Solutions
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx

Hidden Gems in Swift

  • 3. Agenda ‣ Literal Convertibles ‣ String Interpolation ‣ Pattern Matching ‣ Reflection ‣ Objective-C Bridging
  • 5. Literal convertibles struct RegularExpression { let pattern: String init(pattern: String) } let emailRegex = RegularExpression( pattern: "^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$" ) // would be nice let emailRegex = "^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$" 1.0
  • 6. String literal convertible extension RegularExpression: StringLiteralConvertible { typealias StringLiteralType = String init(stringLiteral value: StringLiteralType) { self.pattern = value } } extension RegularExpression: ExtendedGraphemeClusterLiteralConvertible extension RegularExpression: UnicodeScalarLiteralConvertible 1.0
  • 7. All kinds of literals ‣ Array – Array, ArraySlice, Set ‣ Boolean – Bool, ObjCBool ‣ Dictionary – Dictionary, DictionaryLiteral ‣ Float – Float, Double ‣ Nil – Optional, Selector, Pointer ‣ Integer – Int, UInt, Float, Double ‣ String – String, Character, Selector
  • 9. String interpolation enum Byte: UInt8 { case Zero = 0 case One = 1 } let string = "(Byte.Zero)" // "Byte.Zero" // would be nice let string = "(Byte.Zero)" // "0" 1.0
  • 10. Interpolation convertible extension String /* : StringInterpolationConvertible */ { init(stringInterpolationSegment byte: Byte) { self = "(byte.rawValue)" } } let string = "(Byte.Zero)" // "0" 1.0
  • 12. What are patterns? ‣ Enumeration cases ‣ Single equatable values ‣ Ranges and intervals ‣ Value bindings ‣ Type casts ‣ func ~= <T, U> (lhs: T, rhs: U) -> Bool ‣ Tuples of anything above
  • 14. What are patterns? ‣ Enumeration cases ‣ Single equatable values ‣ Ranges and intervals ‣ Value bindings ‣ Type casts ‣ func ~= <T, U> (lhs: T, rhs: U) -> Bool ‣ Tuples of anything above
  • 15. Where do we use them? ‣ Switch statements ‣ If-let bindings ‣ For-in loops ‣ Catch statements
  • 16. case let point = (1, 2) switch point { case (0, 0): println("origin") default: println("arbitrary point") } 1.0
  • 17. case let where let point = (3, 4) switch point { case let (x, y) where x == y: println("point on x = y line") default: println("arbitrary point") } 1.0
  • 18. if let where let point: (Int, Int)? = maybePoint() if let (_, y) = point where y > 0 { println("point above x axis") } 1.2
  • 19. for in where let points = [ (1, 2), (-3, 4), (5, -6), (-7, -8), (9, 10) ] for (x, y) in points where x > 0 && y > 0 { println("point in 1st quadrant: ((x), (y))") } 1.2
  • 20. if case let point = (5, 6) let (width, height) = ( Int(UIScreen.mainScreen().bounds.width), Int(UIScreen.mainScreen().bounds.height) ) if case (0 ... width, 0 ... height) = point { print("point on screen") } 2.0
  • 21. if case let where let point = (7, 8) if case let (x, 1 ..< Int.max) = point where x < 0 { print("point in 2nd quadrant") } 2.0
  • 22. if case let where switch subject { case pattern where condition: // becomes if case pattern = subject where condition { // multiple cases not yet supported if case pattern1, pattern2 = subject { // compiler error 2.0
  • 23. for case let in where let points: [(Int, Int)?] = maybePoints() for case .Some(let (x, y)) in points where x < 0 && y < 0 { print("point in 3rd quadrant: ((x), (y))") } 2.0
  • 24. for case let in where for element in subject { if case pattern = element where condition { // becomes for case pattern in subject where condition { // multiple cases not yet supported for case pattern1, pattern2 in subject { // compiler error 2.0
  • 26. Default behavior struct Vector { typealias Point = (x: Double, y: Double) let start: Point let end: Point var length: Double { return sqrt(pow(end.x - start.x, 2) + pow(end.y - start.y, 2)) } } let unitVector = Vector(start: (0, 0), end: (1, 1)) 2.0
  • 27. Default behavior 2.0 (.0 0, .1 0) (.0 1, .1 1)
  • 28. Reflection methods ‣ Custom description ‣ Custom children tree ‣ Custom Quick Look preview
  • 29. Custom description extension Vector: CustomStringConvertible { var description: String { return "((start.x) × (start.y)) → ((end.x) × (end.y))" } } 2.0
  • 30. Custom description 2.0 "(0.0 × 0.0) → (1.0 × 1.0)"
  • 31. Custom mirror extension Vector: CustomReflectable { func customMirror() -> Mirror { return Mirror(self, children: [ "start": "(start.x) × (start.y)", "end": "(end.x) × (end.y)", "length": length ]) } } 2.0
  • 32. Custom mirror 2.0 start "0.0 × 0.0" end "1.0 × 1.0" length 1.414213562373095
  • 33. Custom preview extension Vector: CustomPlaygroundQuickLookable { func customPlaygroundQuickLook() -> PlaygroundQuickLook { var bezierPath = UIBezierPath() // draw the path return .BezierPath(bezierPath) } } 2.0
  • 35. Reflection principles ‣ Overrides default type descriptors ‣ Provides rich visualization ‣ Read-only
  • 37. Available bridging methods ‣ Inherit from Objective-C classes ‣ @objc attribute ‣ Bridging headers ‣ …and that’s basically it
  • 38. Or is it? @interface NSArray<Element> : NSObject // objective-c class @end struct Array<Element> { // generic swift struct } let swiftArray: [Int] let objcArray = swiftArray as NSArray // no problem 2.0
  • 39. Or is it? @interface NSArray : NSObject @end struct Array<Element>: _ObjectiveCBridgeable { } let swiftArray: [Int] let objcArray = swiftArray as NSArray 2.0
  • 40. Bridgeable protocol _ObjectiveCBridgeable { typealias _ObjectiveCType static func _isBridgedToObjectiveC() -> Bool static func _getObjectiveCType() -> Any.Type func _bridgeToObjectiveC() -> _ObjectiveCType static func _forceBridgeFromObjectiveC(...) static func _conditionallyBridgeFromObjectiveC(...) } 2.0
  • 41. Bridgeable @interface XYZPoint : NSObject - (instancetype)initWithX:(double)x y:(double)y; @property double x; @property double y; @end struct Point { let x: Double let y: Double } 2.0
  • 42. extension Point: _ObjectiveCBridgeable { typealias _ObjectiveCType = XYZPoint static func _isBridgedToObjectiveC() -> Bool { return true } static func _getObjectiveCType() -> Any.Type { return _ObjectiveCType.self } func _bridgeToObjectiveC() -> _ObjectiveCType { return XYZPoint(x: x, y: y) } static func _forceBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Point?) { result = Point(x: source.x, y: source.y) } static func _conditionallyBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Point?) -> Bool { _forceBridgeFromObjectiveC(source, result: &result) return true } } 2.0
  • 43. Bridgeable let objcPoint = XYZPoint(x: 1, y: 2) if let swiftPoint = objcPoint as? Point { // that's right } let objcPoint = XYZPoint(x: 3, y: 4) let swiftPoint = objcPoint as Point // yeah let swiftPoint = Point(x: 5, y: 6) let objcPoint = swiftPoint as XYZPoint // hell yeah let point: XYZPoint = Point(x: 7, y: 8) // mind: blown 2.0
  • 44. Recap ‣ Literal Convertibles ‣ String Interpolation ‣ Pattern Matching ‣ Reflection ‣ Objective-C Bridging
  • 45. How to learn the gems ‣ Carefully read Xcode release notes ‣ Follow right people on Twitter ‣ Study Swift module interface ‣ Use LLDB type lookup ‣ Experiment in playgrounds