UIView
suggest changeSyntax
- // 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 a UIView instance with a CGRect.zero frame
- UIView(frame: CGRect) // Creates a UIView instance specifying the frame
- UIView.addSubview(UIView) // Instance method. Add another UIView as a subview
- UIView.hidden // Swift 2. Get or set the visibility of the view. Swift 3 uses isHidden
- UIView.alpha // Get or set the view’s opacity
- UIView.setNeedsLayout() // Marks the layout dirty. It updates on the next layout pass; layoutIfNeeded updates immediately
Remarks
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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents