ios - How to implement a protocol which has same name as another class -
In Objective-C, @interface and @protocol may have the same names. How can I create a class in Swift to adopt the protocol only?
@interface NICellObject: NSObject & lt; NICellObject & gt; // Named Starters - (ID) initWithCellClass: (class) cell class userInfo: (id) userInfo; - (id) initWithCellClass: (class) cell class; + (ID) ObjectWidell class:: (class) cellclass user information: (id) userInfo; + (Id) ObjectWithLeace: (class) cell class; @property (nonatomic, strong) id userInfo; @end
How to adopt Protocol NICellObject without subclass class NICellObject
< Div class = "post-text" itemprop = "text">
When you import Objective-class faster, the "protocol" will automatically be attached to the name of the protocol. So you just have to adopt xxxxx protocol
I just tried your local project in your case NICellObjectProtocol
The old answer before editing
You take it wrong, they are two different things with the same name. There is a protocol called NICellObject, and also a class NICellObject name
How to implement two protocols faster with a protocol is a class NICellObject in Nimbus which is a protocol and a class, below See the code. There will be a lot of cases in it.
With this link,
Some protocols create several unrelated methods (instead of creating many different protocols) Which are the main manifestations of protocols. In these cases, the conference has to give the same name as protocol class.
And it is not possible to do this in Swift. I am not getting such a document, but with some sign language reference, the announcement introduces a new name or contract in your program.
"An announcement made in a new name or in your program , for example, to apply functions and methods, variables and constants, and new, named computations You use announcements to define the structure, class, and protocol types, you can also use the declaration to increase the behavior of an existing designated type and import symbols in your program. Swiff T programming language ". IBooks
Comments
Post a Comment