dynamic role

As the swift is a static language, so there is no Objective-C messages send these dynamic mechanisms, the role of dynamic is to make swift codes can also have a dynamic mechanism of oc, is commonly used KVO.

Using dynamic keyword tag attributes, the attribute enabled Objc dynamic forwarding;

only for dynamic class, structures, and enumerations can not be used, because they have no inheritance, and Objc dynamic forward is to implement forward based on inheritance.

 

About KVO's dynamic use, see the following link

https://www.jianshu.com/p/ae26100b9edf

Guess you like

Origin www.cnblogs.com/chendingxin/p/10993727.html