The protocol to which all class types implicitly conform.
SDK
- Xcode 6.0.1+
Framework
- Swift Standard Library
Declaration
Discussion
You can use the Any
protocol as the concrete type for an instance of any class. When you do, all known @objc
class methods and properties are available as implicitly unwrapped optional methods and properties, respectively. For example:
The get
function uses optional chaining to safely call the implicitly unwrapped class method on c
. Calling the function with different class types shows how the get
class method is only conditionally available.