Reputation: 71
It's not a big problem, but I was a bit confused when I faced it for the first time. This was the original declaration for an Obj C delegate method:
- (void)serialPortWasRemovedFromSystem:(ORSSerialPort *)serialPort
And when I translated it in swift it became:
func serialPortWasRemovedFromSystem(_ serialPort: ORSSerialPort)
But later Xcode showed an error and suggested me to change the name, because it was deprecated, in this one:
func serialPortWasRemoved(fromSystem serialPort: ORSSerialPort)
Why did they change this delegate name so many times? Can you tell me why? Thank you! ~
Upvotes: 2
Views: 2055
Reputation: 119
I agree with @matt. The Objective-C APIs are "renamified" to make their names terser and more Swift-like
// Objective-c SampleObC.h
@interface SampleObC : NSObject
+(void)getSampleName;
+(void)setSampleName;
}
// Swift
class SampleSwift {
// Sample Class Name is ignored.
SampleObC.getName()
SampleObC.setName()
}
Upvotes: -1