Sunday, August 30, 2015

Subview and Superview(IOS 8)

A view (an object whose class is UIView or a subclass of UIView) knows how to draw
itself into a rectangular area of the interface. Your app has a visible interface thanks to
views. Creating and configuring a view can be extremely simple: “Set it and forget it.”
For example, you can drag an interface object, such as a UIButton, into a view in the
nib editor; when the app runs, the button appears, and works properly. But you can also
manipulate views in powerful ways, in real time. Your code can do some or all of the
view’s drawing of itself  it can make the view appear and disappear, move,
resize itself, and display many other physical changes, possibly with animation


Because view objects are the main way your application interacts with the user, they have many responsibilities. Here are just a few:
  • Layout and subview management
    • A view defines its own default resizing behaviors in relation to its parent view.
    • A view can manage a list of subviews.
    • A view can override the size and position of its subviews as needed.
    • A view can convert points in its coordinate system to the coordinate systems of other views or the window.
  • Drawing and animation
    • A view draws content in its rectangular area.
    • Some view properties can be animated to new values.
  • Event handling
    • A view can receive touch events.
    • A view participates in the responder chain.

No comments:

Post a Comment