【UIKit.framework】UIView UIControl UIViewController 三者的区别

UIView:

The UIView class defines a rectangular area on the screen and the interfaces for managing the content in that area. At runtime, a view object handles the rendering of any content in its area and also handles any interactions with that content. The UIView class itself provides basic behavior for filling its rectangular area with a background color. More sophisticated content can be presented by subclassingUIView and implementing the necessary drawing and event-handling code yourself. The UIKit framework also includes a set of standard subclasses that range from simple buttons to complex tables and can be used as-is. For example, aUILabel object draws a text string and a UIImageView object draws an image.



UIControl:

UIControl is the base class for control objects such as buttons and sliders that convey user intent to the application. You cannot use theUIControl class directly to instantiate controls. It instead defines the common interface and behavioral structure for all its subclasses.

The main role of UIControl is to define an interface and base implementation for preparing action messages and initially dispatching them to their targets when certain events occur.

For an overview of the target-action mechanism, see“Target-Action in UIKit” in Cocoa Fundamentals Guide. For information on the Multi-Touch event model, seeEvent Handling Guide for iOS.

The UIControl class also includes methods for getting and setting control state—for example, for determining whether a control is enabled or highlighted—and it defines methods for tracking touches within a control. These tracking methods are overridden by UIControl subclasses.


UIViewController:

View controllers present and manage a hierarchy of views. The UIKit framework includes classes for view controllers you can use to set up many of the common user interaction idioms in iOS. You use these view controllers with any custom view controllers you may need to build your app’s user interface. This document describes how to use the view controllers that are provided by the UIKit framework.

Navigation Controllers Manage Stacks of Other View Controllers

Tab Bar Controllers Manage Independent Sets of View Controllers

Page View Controllers Manage Paged Display of View Controllers

Split View Controllers Manage Two Panes of Information

Popovers Present Content in a Floating View

View Controllers Are Combined to Build More Sophisticated Interfaces



  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值