iOS -Category(OC) and Extension(swift) differences

English:

Category: in Objective-c Category can be used to add extra method to the class, but without property.

Extension: in swift we can use extension to add method, property and protocol to class. when extension used in protocol we need to implement the method we add to protocol.

 

posted @ 2015-11-12 15:05  李扬  阅读(244)  评论(0编辑  收藏  举报