Static properties in Swift
问题 I'm trying to convert the following Objective-C code to Swift. In my Objective-C code, there's a static variable and its accessed from a class method. @implementation SomeClass static NSMutableArray *_items; + (void)someMethod { [_items removeAll]; } @end Since you can't access types declared like this private var items = [AnyObject]() from class functions in Swift, I created a stored property for it like this. class var items: [AnyObject] { return [AnyObject]() } And I'm trying to call a