- @objc 在
swift
中的作用- 许多框架是用OC写的,在
swift
中定义的方法需要被作为一个selector
使用时,因为selector
是OC中的概念,所以要想将swift中的方法当作OC中的selector使用就必须要用到@objc
; -
KVC
需要@objc
的支持;
- 许多框架是用OC写的,在
https://stackoverflow.com/questions/30795117/when-to-use-objc-in-swift
swift
中的作用
swift
中定义的方法需要被作为一个selector
使用时,因为selector
是OC中的概念,所以要想将swift中的方法当作OC中的selector使用就必须要用到@objc
;KVC
需要@objc
的支持;https://stackoverflow.com/questions/30795117/when-to-use-objc-in-swift