2024/8/21
laprasdrum.icon 13時以降集中できない
/icons/hr.icon
SwiftにおけるAny
Any can represent an instance of any type at all, including function types.
AnyObject can represent an instance of any class type.
Use Any and AnyObject only when you explicitly need the behavior and capabilities they provide. It’s always better to be specific about the types you expect to work with in your code.
In Swift 3, the id type in Objective-C now maps to the Any type in Swift, which describes a value of any type, whether a class, enum, struct, or any other Swift type.
https://scrapbox.io/files/66c4f27c62258a001c1c838c.png
AnyはValue Object、AnyObject はClassとして区分されてる。
Objective-C interfaces that use id and untyped collections should be imported into Swift as taking the Any type instead of AnyObject.