Can't add class objects to Objective-C collections in Swift
| Originator: | exsephiroth87 | ||
| Number: | rdar://17240026 | Date Originated: | 09/06/2014 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode Version 6.0 (6A215l) |
| Classification: | Reproducible: | Always |
Summary: Trying to add a class object to a collection gives a swift compiler error / playground execution failure Steps to Reproduce: Sample code var objClass = NSObject.self var array = NSMutableArray() array.addObject(objClass) Expected Results: The class is added to the collection Actual Results: type 'NSObject.Type' does not conform to protocol 'AnyObject'
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!