This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Department { } | |
protocol Employee { | |
// warning: 'weak' should not be applied to a property declaration in a protocol | |
// and will be disallowed in future versions | |
weak var department: Department? { get } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Point: Hashable { | |
let x: Float | |
let y: Float | |
} | |
let p1 = Point(x: 0.0, y: 0.0) | |
let p2 = Point(x: 1.0, y: 1.0) | |
p1 == p2 // false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
protocol ObjectMapper { | |
associatedtype SourceType | |
associatedtype ResultType | |
func map(_ object: SourceType) -> ResultType |
NewerOlder