Universal (dynamic) types

//Any holds a value of any type at all,
//AnyObject - of any class type
var value: Any = 42
//value is 42
print("value is \(value)")

value = "text"
//value is "text"
print("value is \(value)")

value = [123]
//value is [1, 2, 3]
print("value is \(value)")

class Man {
    var name = "Vladimir"
}

let object: AnyObject = Man()
//object is a Man instance
print("object is \(type(of: object))")

//A mixed collection is typed [Any]
let things: [Any] = [1"two"3.0Man()]
//count is 4
print("count is \(things.count)")