I am having trouble accessing my quick extension with objective-c.
I have the following code in a .swift file:
extension NSDictionary { func dictionaryAsJsonString() -> NSString { var err: NSError? var data = NSJSONSerialization.dataWithJSONObject(self, options: NSJSONWritingOptions.PrettyPrinted, error: &err) var string = NSString(data: data, encoding: NSUTF8StringEncoding) return string } }
I expect I can do the following in my .m file:
[dictionary dictionaryAsJsonString]
but he cannot find my method and is not autocomplete.
I know that my import is working fine because I can access my other fast objects.
ios objective-c swift swift-extensions
Olshansk
source share