AnyObject is a Swift representation of type Objective-C id . It is more general than NSObject (i.e., every NSObject is AnyObject , but not every AnyObject is NSObject ).
On the other hand, the question depends on how you are going to use the structure. Using a more specific class for the general structure (Swift-typed array or dictionary) will allow you to take advantage of strong typing, while using a more universal type will allow you to be more dynamic. Actually, it depends on what you are going to use for the class.
source share