Questions tagged [anyobject]

`AnyObject` can be used to represent any type in Swift that is a class. Value types (Structs and enums) can be represented using `Any`. Use this tag for questions concerning the use of `AnyObject` and how to handle it.

AnyObject can be used to represent any type in Swift that is a class. Value types (Structs and enums) can be represented using Any. In migration from Objective-C to Swift, some methods might return a reference type in Objective-C whose type cannot be precisely known. This is where it's type is represented as AnyObject in Swift.

121 questions
-4
votes
1 answer

equivalent to [obj class] in Swift?

How to get the class of an anyObject type in Swift? In Objective-C we can get it like so : id obj = [obj class]
SOUA Hamza
  • 146
  • 2
  • 10
1 2 3
8
9