Swift
Any, AnyObject, NSObject
What can Any, AnyObject, and NSObject each hold?
How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
What can Any, AnyObject, and NSObject each hold?
Any holds any type, including values and functions; AnyObject is class-only and holds just class instances; NSObject holds instances of the Objective-C runtime's root class.
SwiftShort answerAdvanced
From the caller's side, what's the difference between func make() -> some Shape and func…
#any #existential
SwiftShort answerAdvanced
You have an Iterator protocol with getNext() and hasNext(), and you want to change it…
#any
SwiftShort answerExpert
A Swift module has to call into legacy Objective-C code and be called from it. How do you…
#objc
SwiftShort answerBasics
During code review you find the same logic overloaded per type: func larger(_ a: Int, _…
#any