// Objective-C
[UIView new] // Get a view object allocated and initialized
[[UIView alloc] initWithFrame:(Pass CGRect)] // Get the view allocated and initialized with a frame
[[UIView alloc] init] // Get a view object allocated and initialized
// Swift
UIView() // Creates an UIView instance with CGRect.zero frame
UIView(frame: CGRect) // Creates an UIView instance specifying the frame
UIView.addSubview(UIView) // add an another UIView instance as subview
UIView.hidden // Get or set the visibility of the view
UIView.alpha // Get or set the view's opacity
UIView.setNeedsLayout() // Forces the view to update its layout
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.