<aside> 🚨 Any 와 AnyObject 는 정말 필요한 경우에만 사용해야 한다.
구체적인 타입이 아닌 아무 타입 으로 작업하기 위해 스위프트가 제공하는 두 가지 특별한 타입
Casting doesn’t actually modify the instance or change its values. The underlying instance remains the same; it’s simply treated and accessed as an instance of the type to which it has been cast.
Any 는 함수 타입을 포함한 어떠한 타입의 인스턴스든 가리킬 수 있다.
var things: [Any] = []
things.append(0)
things.append(0.0)
things.append(42)
things.append(3.14159)
things.append("hello")
things.append((3.0, 5.0))
things.append({ (name: String) -> String in "Hello, \\(name)" })
메타타입 인스턴스도 넣을 수 있음
let any: Any = Int.self
옵셔널 인스턴스도 넣을 수 있음
let someValue: Any = Optional<Int>.some(3)