开发者

The different of the class name that having **Delegate** and haven't have **Delegate** in iOS API

In iOS API, we can see UITabBarItem Class Reference and UITabBarDelegate Protocol Reference... when we search for the keyword "tabbar", I want to as开发者_C百科k what is the different between the class name having Delegate and haven't have Delegate?

Thanks


UITabBarDelegate isn't a class, its protocol - declaration which function contains class, that adopts this protocol. There is speсial property in class UITabBarItem named delegate, by which it can refer to an object of this class with protocol and execute methods of the protocol


They are just names.

These are Classes - You have the UITabBarController (controller for the view) The UITabBarView (what is displayed on the screen)

This is a Protocol - The UITabBarDelegate (an object that responds to events, usually also the controller)

The "Delegate" name is just a convention that is used by Apple to indicate its role (for example, AppDelegate is another one).

Unfortunately, I cannot really answer more than that beyond the scope of iOS development. You need to understand the difference between Class and Delegate; in that case, this post should be moved to Programmers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜