iOS UIView

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  1. // Objective-C

  2. [UIView new] // Get a view object allocated and initialized

  3. [[UIView alloc] initWithFrame:(Pass CGRect)] // Get the view allocated and initialized with a frame

  4. [[UIView alloc] init] // Get a view object allocated and initialized

  5. // Swift

  6. UIView() // Creates an UIView instance with CGRect.zero frame

  7. UIView(frame: CGRect) // Creates an UIView instance specifying the frame

  8. UIView.addSubview(UIView) // add an another UIView instance as subview

  9. UIView.hidden // Get or set the visibility of the view

  10. UIView.alpha // Get or set the view's opacity

  11. UIView.setNeedsLayout() // Forces the view to update its layout

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.



Got any iOS Question?