iOS development - UIView
class UIView : UIResponder
UIView class API provides general behavior for any view in an application. This general behavior includes displaying content and handling user interactions. By default,
UIView enables setting a static background color. This simple behavior can be extended through subclassing.
UIKit includes built-in
UIView subclasses such as
UIButton, and more, which are ready to be used for constructing custom views.
- drawing and animation (using
UIKitor Core Graphics)
- layout and subview management
- user events (
UIViewis a subclass of
UIResponder, enabling it to respond to user interactions)
Views can be created using a visual tool like Storybook, or programmatically.
Views will be drawn (and redrawn) by the system using an internal lifecycle, called the “drawing cycle”.
Views are often organized hierarchically, such that related content is nested together, not unlike HTML. “Subviews” can visually overflow their “superviews” by default, but this can be changed via the
bounds properties which define the origin and dimensions relative to the superview and the internal dimensions of the view, respectively.
View changes and multithreading
Manipulations to views must always occur on the main thread of the application, meaning that
UIView class methods should only ever be called by code running on the main thread.