Swift
Escaping closures
This code doesn't compile. What is the compiler asking for?
final class Loader {
var handlers: [() -> Void] = []
func register(_ handler: () -> Void) {
handlers.append(handler)
}
}Escaping closures
This code doesn't compile. What is the compiler asking for?
final class Loader {
var handlers: [() -> Void] = []
func register(_ handler: () -> Void) {
handlers.append(handler)
}
}Memory and ARCMultiple choiceBasics
Which of these two snippets creates a reference cycle? …
#closure #capture
Memory and ARCShort answerAdvanced
What actually happens in memory when a closure captures an outside variable? Using the ou…
#closure #capture
SwiftMultiple choiceBasics
Which of these statements about Swift language rules are correct? Pick all that apply.
#closure
ArchitectureShort answerIntro
Can you explain the Delegate pattern that shows up all over UIKit?
#closure