@objc func handleTappedOnSignInButton() {...}
LoginPresenter
I present a view onto the storage of an array.
ArraySlice
var array = [1, 2, 3]
for num in array {
array.removeFirst()
print(num)
}
1
2
3
How old is Adam?
23 Months
This mammal can't jump.
Elephant
public func double(for key: FlexStorage.Key, defaultValue: Double = 0.0) -> Double {...}
FlexStorage
I can be used to group and run two or more animations simultaneously.
CAAnimationGroup
protocol Greeter {
func greet()
}
extension Greeter {
func greet() { print("Hello from protocol") }
}
struct Person: Greeter {
func greet() { print("Hello from struct") }
}
let greeter: Greeter = Person()
greeter.greet()
Hello from protocol
What bone have I broken?
Leg
This is the only U.S. state with a one-syllable name.
Maine
func boost(from boostPlacement: BoostPlacement, shouldShowNowOrLater: Bool) {...}
LikesYouPresenter
Public Key or Certificate Pinning
struct Point {
var x: Int
}
func move(_ point: inout Point) {
point.x += 10
}
var p = Point(x: 5)
move(&p)
print(p.x)
15
I've gone skydiving
I've gone bungee jumping
I've never been to Disney World.
I've gone bungee jumping
You see me once in June, twice in November, but never in May. What am I?
func rotateUsers(direction: RotationDirection, onCompletion: (() -> Void)? = nil) {...}
DiscoveryProfilePresenter
I am responsible for keeping the main thread alive.
Run loop.
var handlers: [() -> Void] = []
func addHandler() {
var message = "Hello"
handlers.append {
print(message)
}
message = "Goodbye"
}
addHandler()
handlers.first?()
Goodbye
How long is my commute door to door?
~2.5 hours
This company created the first graphical web browser in the early 1990s.
Netscape
func createConnection(from userJson: Json.Dictionary) -> Connection? {...}
ConnectionFactory
I make use of the Objective-C runtime to allow you to attach an object to another at runtime, effectively simulating stored properties on instances you don't own.
associated objects (e.g., objc_setAssociatedObject)
var x = 0
let compute: () -> Int = {
x += 1
return x
}
let lazyValue: Int = {
let result = compute()
return result
}()
print(x)
1
What would I do if I won the lottery?
Go back to school and/or buy land and a farm.
This U.S. state was an independent country before joining the Union in 1845.
Texas