3 ms·
Isn't it true that some messages are sent dynamically in Swift? (For example, if you are messaging an Obj-C instance)
by nielsbot 12y ago
Isn't it true that some messages are sent dynamically in Swift? (For example, if you are messaging an Obj-C instance)
- bjustin 12y agoIf a Swift class is made available to Objective-C code (using the @objc annotation, or subclassing an Objective-C class), that class will use message sends for calling methods. Using an Objective-C class, or a @objc Swift class, from Swift will also use message sends for method calls.
- adrianm 12y agoYes. Run some Swift code in Xcode with the debugger and step through its execution; you can see that Objective-C objects proliferate through Swift. Cocoa APIs are especially Objective-C compatible, as to be expected.