@objc and dynamic Objective-C runtime visibility and the depths of dynamic dispatch in the modern Swift era. 5 December 2017 ∙ Objective-C Interop ∙ written by Greg Heo The @objc attribute controls visibility of Swift bits from Objective-C. It’s ba…
One can explicitly write @objc on any Swift declaration that can be expressed in Objective-C. @objc相关的参量只能修饰类.类的成员.扩展以及只能被类实现的协议: 下面开列修饰的情况和说明 一.无修饰 NSObject-derived classes no longer infer @objc A declaration within an NSObject-derived class will no…