After getting help yesterday, I still canβt completely wrap my question around myself or why the following is allowed:
let string = NSString.hasPrefix("aString")
It seems to me that I'm just calling the instance method directly from the class. In the above example, this does not make much sense, but obviously this is allowed, since it compiles without warning and starts without any errors.
Any help in eradicating this part of my (vast) ignorance regarding Swift would be greatly appreciated.
Edit: Perhaps this is because there is nothing in Swift to separate the class and instance methods and the way to deal with this mismatch between Objective-C and Swift?
source
share