0% found this document useful (0 votes)
25 views

UIView

This document summarizes key aspects of UIView in iOS, including initialization, view hierarchy, layout, geometry, user interaction, drawing, animation, and observing view-related changes. It covers initializing views, adding and arranging subviews, setting frames and bounds, handling user input, triggering redraws, and converting between coordinate systems. Methods for layout, drawing, animation and responding to view changes are also listed.

Uploaded by

Hung Nguyen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

UIView

This document summarizes key aspects of UIView in iOS, including initialization, view hierarchy, layout, geometry, user interaction, drawing, animation, and observing view-related changes. It covers initializing views, adding and arranging subviews, setting frames and bounds, handling user input, triggering redraws, and converting between coordinate systems. Methods for layout, drawing, animation and responding to view changes are also listed.

Uploaded by

Hung Nguyen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

tag

-viewWithTag

Tag

< NSResponsder < UIView

superview

> UILabel - UIImageView - UISlider

Class Inheritance

subviews

> UIControl > UIButton - UITextField

window

-initWithFrame:

-addSubview:

Initialisation

-bringSubviewToFront:

init without parameter, set frame


later

-sendSubviewToBack:

backgroundColor

View Hierarchy

-removeFromSuperview

hidden

-insertSubview:atIndex:

alpha

-insertSubview:aboveSubView:

opaque

-insertSubview:belowSubView:

tintColor

-exchangeSubviewAtIndex:

Visual Appearance

tintAdjustmentMode

-isDescendantOfView:

clipsToBounds

userInteractionEnabled

clearsContextBeforeDrawing

multipleTouchEnabled

User interaction

maskView

exclusiveTouch

layerClass

UIView

-layoutSubviews
-setNeedsLayout
-layoutIfNeeded

layer
frame

Layout subviews
Geometry

add/remove constrains
measuring layout

bounds
center
transform

Layout Constrains

-convertPoint:toView:

trigger constrain based layout


Coordinate conversion

-addGestureRecognizers
-removeGestureRecognizer

Gesture Recognisers

-hitTest:withEvent:
-pointInside:withEvent:

Hit test

Draw / update View

-didMoveToWindow

-setNeedsDisplay
-setNeedsDisplayinRect:
-tintColorDidChange

-willRemoveSubview:

-willMoveToWindow:

-convertRect:fromView:

-drawRect:

-didAddSubview:

-divMovetoSuperview:

-convertPoint:fromView:

-convertRect:toView:

-gestureRecognizerShouldBegin

-willMoveToSuperview:

[email protected]

animateWithDuration:...
Observing View-Related Change

Animation

transitionWithView
animateKeyframesWithDuration

You might also like