UIkit框架之Uivew

1.繼承鏈:UIresponder:NSObjecthtml

2.經過使用 addGestureRecognizer:方法能夠爲視圖添加手勢spring

3.下面的屬性均可以用來用於動畫api

4.子視圖通常用來進行覆蓋的方法:

    (1)initWithFrame:通常用來初始化一個UI控件,位置和大小

    (2)initWithCoder:使用這個方法來載入你的nib file文件到interface builder中

    (3)layerClass:不知道怎麼翻譯 Implement this method only if you want your view to use a different Core Animation layer for its backing store.

    (4)drawRect:通常用來繪製你的自定義視圖內容

 

    (5)drawRect:forViewPrintFormatter:當你想在你的自定義視圖中定義不一樣的視圖內容能夠重載這個方法

    (6)requiresConstraintBasedLayout:若是你想要正確的約束你的視圖可使用這個方法

    (7)updateConstraints:若是你的視圖和你的子視圖要建立有一個自定義約束可使用這個方法,應該是用來更新約束的把

    (8)alignmentRectForFrame:frameForAlignmentRect:實現讓你的視圖如何和其餘視圖對齊

    (9)sizeThatFits: - Implement this method if you want your view to have a different default size than it normally would during resizing operations.

    (10)layoutSubviews:使用這個方法來使你的視圖更加精確的佈局而不使用那些約束

    (11)didAddSubview:willRemoveSubview:能夠用來更加或者刪除一些視圖

    (12)willMoveToSuperview:didMoveToSuperview - Implement these methods as needed to track the movement of the current view in your view hierarchy.

    (13)willMoveToWindow:didMoveToWindow - Implement these methods as needed to track the movement of your view to a different window.

    (14)touchesBegan:withEvent:touchesMoved:withEvent:touchesEnded:withEvent:touchesCancelled:withEvent:當發生觸碰事件的時候可使用這些方法

    (15)gestureRecognizerShouldBegin:發生觸碰時間或者其餘的手勢時間的時候可使用這個方法

5.UIview的方法大全:

/** 獲取到事件中點擊的視圖用來判斷當前點擊 */

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{

    /** 獲取事件event中的觸發視圖*/

    UIView *hitView = [superhitTest:point withEvent:event];

    /** 判斷是否當前視圖 */

    if (hitView ==self) {

        returnnil;

    } else {

        return hitView;

    }

}

 

/** 判斷是不是當前視圖觸發的事件 */

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{

    return [superpointInside:point withEvent:event];

}

 

/** 將一個座標點轉換成指定view的座標 */

- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view{

    return [superconvertPoint:point toView:view];

}

 

/** 將一個座標點轉換成當前view的座標 */

- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view{

    return [superconvertPoint:point fromView:view];

}

 

/** 將一個CGRect轉換成指定view的CGRect */

- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view{

    return [superconvertRect:rect toView:view];

}

 

/** 講一個CGRect轉換成當前view的CGRect */

- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view{

    return [superconvertRect:rect fromView:view];

}

 

/** 獲取適合label內容的CGSize */

- (CGSize)sizeThatFits:(CGSize)size{

    return [supersizeThatFits:size];

}

 

/** 自動設置適合內容的CGSize */

- (void)sizeToFit{

    [supersizeToFit];

}

 

/** 從父視圖中移除當前視圖 */

- (void)removeFromSuperview{

    [superremoveFromSuperview];

}

 

/** 在index層插入一個視圖 */

- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index{

    [superinsertSubview:view atIndex:index];

}

 

/** 交換兩個視圖的圖層 */

- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2{

    [superexchangeSubviewAtIndex:index1 withSubviewAtIndex:index2];

}

 

/** 加入一個視圖在最上一層 */

- (void)addSubview:(UIView *)view{

    [superaddSubview:view];

}

 

/** 在siblingSubview視圖下面插入一個視圖 */

- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview{

    [superinsertSubview:view belowSubview:siblingSubview];

}

 

/** 在siblingSubview視圖上面插入一個視圖 */

- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview{

    [superinsertSubview:view aboveSubview:siblingSubview];

}

 

/** 將一個視圖放到最上一層 */

- (void)bringSubviewToFront:(UIView *)view{

    [superbringSubviewToFront:view];

}

 

/** 將一個視圖推送到最下層 */

- (void)sendSubviewToBack:(UIView *)view{

    [supersendSubviewToBack:view];

}

 

/** 添加子視圖時調用 */

- (void)didAddSubview:(UIView *)subview;{

    [superdidAddSubview:subview];

    NSLog(@"添加子視圖");

}

 

/** 將要移除子視圖時調用 */

- (void)willRemoveSubview:(UIView *)subview{

    [superwillRemoveSubview:subview];

    NSLog(@"移除子視圖");

}

 

/** 父視圖將要發生更改時調用 */

- (void)willMoveToSuperview:(UIView *)newSuperview{

    [superwillMoveToSuperview:newSuperview];

    NSLog(@"父視圖將要發生更改");

}

 

/** 父視圖更改時調用 */

- (void)didMoveToSuperview{

    [superdidMoveToSuperview];

    NSLog(@"父視圖發生更改");

}

 

/** 視圖或其超視圖將要展現到窗口調用 */

- (void)willMoveToWindow:(UIWindow *)newWindow{

    [superwillMoveToWindow:newWindow];

    NSLog(@"視圖展現到窗口");

}

 

/** 視圖或其超視圖展現到窗口調用 */

- (void)didMoveToWindow{

    [superdidMoveToSuperview];

    NSLog(@"視圖或其超視圖展現到窗口");

}

 

/** 判斷當前視圖是不是指定視圖或者其子視圖 */

- (BOOL)isDescendantOfView:(UIView *)view{

    return [superisDescendantOfView:view];

}

 

/** 獲取當前視圖內指定tag值的視圖 */

- (UIView *)viewWithTag:(NSInteger)tag{

    return [superviewWithTag:tag];

}

 

/** 在圖層繪製時調用的方法 */

- (void)setNeedsLayout{

    

}

- (void)layoutIfNeeded{

    

}

 

/** 當視圖上的圖層發生改變時調用 */

- (void)layoutSubviews{

    

}

 

/** 發生自動佈局時調用 */

- (void)layoutMarginsDidChange{

    

}

 

/** 繪製圖層layer時調用 */

- (void)drawRect:(CGRect)rect{

    

}

 

/** 重繪圖層 */

- (void)setNeedsDisplay{

    

}

 

/** 重繪圖層指定範圍 */

- (void)setNeedsDisplayInRect:(CGRect)rect{

   

}

 

/** tintColor 是一種有拋光效果的設置視圖顏色 */

/** tintColor改變時調用 */

- (void)tintColorDidChange{

    

}

 

#pragma mark - 動畫相關

/** 開啓動畫塊 animationID動畫標示 context參數 */

+ (void)beginAnimations:(NSString *)animationID context:(void *)context{

    [superbeginAnimations:animationID context:context];

}

 

/** 提交動畫塊動畫開始執行 */

+ (void)commitAnimations{

    [supercommitAnimations];

}

 

/** 設置動畫代理 */

+ (void)setAnimationDelegate:(id)delegate{

    [supersetAnimationDelegate:delegate];

}

 

/** 當動畫開始時發送一個消息給動畫代理 */

+ (void)setAnimationWillStartSelector:(SEL)selector{

    [supersetAnimationWillStartSelector:selector];

    /** 動畫代理執行selector方法 */

}

 

/** 當動畫結束時發送一個消息給動畫代理 */

+ (void)setAnimationDidStopSelector:(SEL)selector{

    [supersetAnimationDidStopSelector:selector];

    /** 動畫代理執行selector方法 */

}

 

/** 設置動畫時長默認0.2s */

+ (void)setAnimationDuration:(NSTimeInterval)duration{

    [supersetAnimationDuration:duration];

}

 

/** 設置動畫執行延遲時長默認0s */

+ (void)setAnimationDelay:(NSTimeInterval)delay{

    [supersetAnimationDelay:delay];

}

 

/** 設置動畫開始時間NSDate */

+ (void)setAnimationStartDate:(NSDate *)startDate{

    [supersetAnimationStartDate:startDate];

}

 

/** 設置動畫的曲線方式(就是動畫的整體變化的時間曲線:開始快最後慢,開始慢最後快,最後慢,均勻線性)。

 

    curve參數以下:

 

    typedef NS_ENUM(NSInteger, UIViewAnimationCurve) {

    UIViewAnimationCurveEaseInOut,         // slow at beginning and end

    UIViewAnimationCurveEaseIn,            // slow at beginning

    UIViewAnimationCurveEaseOut,           // slow at end

    UIViewAnimationCurveLinear

    }; 

 */

+ (void)setAnimationCurve:(UIViewAnimationCurve)curve{

    [supersetAnimationCurve:curve];

}

 

/** 設置動畫重複次數 */

+ (void)setAnimationRepeatCount:(float)repeatCount{

    [supersetAnimationRepeatCount:repeatCount];

}

 

/**  

    設置動畫是否作一次反向的執行。

    若是設置爲YES:動畫將執行:動畫初始狀態》動畫》動畫完成狀態》動畫》動畫初始狀態。

    若是設置爲NO:默認值 

 */

+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses{

    [supersetAnimationRepeatAutoreverses:repeatAutoreverses];

}

 

/** 設置動畫開始時狀態

 當YES時:當上一次動畫正在執行中,那麼當下一個動畫開始時,上一次動畫的當前狀態將成爲下一次動畫的開始狀態。

 當NO時:當上一個動畫正在執行中,那麼當下一個動畫開始時,上一次動畫須要先恢復到完成時的狀態,而後在開始執行下一次動畫。

 */

+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState{

    

}

 

/** 添加動畫到視圖view上 transition動畫樣式 cache爲YES時高效 但動畫執行過程當中不能更新UI爲NO時每一幀均可以從新繪製 能夠實時更新UI */

+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView*)view cache:(BOOL)cache{

    

}

 

/** 是否支持動畫默認YES */

+ (void)setAnimationsEnabled:(BOOL)enabled{

    

}

 

/** 返回動畫效果是否被禁用 */

+ (BOOL)areAnimationsEnabled{

    return [superareAnimationsEnabled];

}

 

/** 強制一些動做不使用動畫我也不懂 測出來再補上 */

+ (void)performWithoutAnimation:(void (^)(void))actionsWithoutAnimation{

    

}

 

#pragma mark - 動畫Block塊

/**

 duration   執行時長

 delay      延遲時長

 options    動畫執行曲線

 animations 動畫動做Block

 completion 動畫執行完畢後執行的Block

 */

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion {

    

}

 

/**

 duration   執行時長

 animations 動畫動做Block

 completion 動畫執行完畢後執行的Block

 */

+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion {

    

}

 

/** 

 duration   執行時長

 animations 動畫動做Block

 */

+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations {

    

}

 

/** 

 SpringAnimation動畫乾淨 快速

 usingSpringWithDamping 0~1 彈簧效果越小彈簧效果越明顯 

 initialSpringVelocity  初始速度初始速度取值較高而時間較短時 也會出現彈簧效果

 */

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion {

    

}

 

/** 

 過場動畫

 duration   動畫時長

 view       進行轉場動畫的視圖

 options    專場動畫類型

 animations 執行動畫

 completion 動畫結束後調用的Block

 */

+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void(^)(BOOL finished))completion {

    

}

 

/**

 過場動畫

 [fromView.superview addSubview:toView];

 [fromView.superview removeFromSuperview];

 */

+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion {

    

}

 

/**

 在一組視圖上執行指定的系統動畫,並能夠並行自定義的動畫

 parallelAnimations就是與系統動畫並行的自定義動畫

 */

+ (void)performSystemAnimation:(UISystemAnimation)animation onViews:(NSArray *)views options:(UIViewAnimationOptions)options animations:(void (^)(void))parallelAnimations completion:(void (^)(BOOL finished))completion {

    

}

 

#pragma mark - UIViewKeyframeAnimations

/** 

 關鍵幀動畫

 duration   動畫時長

 delay      動畫延遲

 options    動畫效果選項

 animations 動畫執行代碼

 completion 動畫結束執行代碼

 */

+ (void)animateKeyframesWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options animations:(void(^)(void))animations completion:(void (^)(BOOL finished))completion {

    

}

 

/**

 frameStartTime 動畫相對開始時間

 frameDuration  動畫相對持續時間

 自身會根據動畫總持續時長自動匹配其運行時長

 */

+ (void)addKeyframeWithRelativeStartTime:(double)frameStartTime relativeDuration:(double)frameDuration animations:(void (^)(void))animations {

    

}

 

#pragma mark - 手勢

/** 添加手勢 */

- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer {

    

}

 

/** 移除手勢 */

- (void)removeGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer {

    

}

 

/** 是否執行該手勢 */

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {

    returnYES;

}

 

/** 添加運動擬真效果 */

/** UIMotionEffect 運動擬真效果類物理效果 */

- (void)addMotionEffect:(UIMotionEffect *)effect {

    

}

/** 移除運動擬真效果 */

- (void)removeMotionEffect:(UIMotionEffect *)effect {

    

}

 

#pragma mark - 約束自動佈局

/** 只知道是自動佈局相關可是具體效果 未知查不到 測不出==! */

- (NSArray *)constraints {

    return [superconstraints];

}

 

/** 添加約束須要先開啓自動佈局 */

- (void)addConstraint:(NSLayoutConstraint *)constraint {

    

}

 

/** 添加約束 */

- (void)addConstraints:(NSArray *)constraints {

    

}

 

/** 移除約束 */

- (void)removeConstraint:(NSLayoutConstraint *)constraint {

    

}

 

/** 移除約束 */

- (void)removeConstraints:(NSArray *)constraints {

    

}

 

/** 更新視圖和其子視圖的約束 */

- (void)updateConstraintsIfNeeded {

    

}

 

/** 更新視圖和其子視圖的約束 */

- (void)updateConstraints {

    

}

 

/** 是否更新視圖的約束 */

- (BOOL)needsUpdateConstraints {

    return [superneedsUpdateConstraints];

}

 

/** 設置視圖的約束須要更新 */

- (void)setNeedsUpdateConstraints {

    

}

 

/** 是否關閉自動佈局 */

- (BOOL)translatesAutoresizingMaskIntoConstraints {

    return [supertranslatesAutoresizingMaskIntoConstraints];

}

 

/** 是否關閉自動佈局 */

- (void)setTranslatesAutoresizingMaskIntoConstraints:(BOOL)flag {

    

}

 

/** 是否支持自動佈局 */

+ (BOOL)requiresConstraintBasedLayout {

    return [superrequiresConstraintBasedLayout];

}

 

/** 返回給定框架的視圖的對齊矩陣 */

- (CGRect)alignmentRectForFrame:(CGRect)frame {

    return [superalignmentRectForFrame:frame];

}

 

/** 返回給定對齊矩形的視圖的frame  */

- (CGRect)frameForAlignmentRect:(CGRect)alignmentRect {

    return [superframeForAlignmentRect:alignmentRect];

}

 

/** 對當前View設置用來佈局的矩形設置偏移 */

- (UIEdgeInsets)alignmentRectInsets {

    return [superalignmentRectInsets];

}

 

/** 默認返回當前視圖的底部做爲baseline。咱們能夠重寫上述方法,但必須返回的是當前視圖中的子視圖 */

- (UIView *)viewForBaselineLayout {

    return [superviewForBaselineLayout];

}

 

/** 經過重寫intrinsicContentSize能夠設置當前視圖顯示特定內容時的大小 */

- (CGSize)intrinsicContentSize {

    CGSize size = [superintrinsicContentSize];

    if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact) {

        size.width +=4.0f;

    } else {

        size.width +=40.0f;

    }

    

    if (self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact) {

        size.height +=4.0;

    } else {

        size.height +=40.0;

    }

    

    return size;

}

 

/** 視圖根據內部內容設置Size */

- (void)invalidateIntrinsicContentSize {

    [superinvalidateIntrinsicContentSize];

}

 

- (UILayoutPriority)contentHuggingPriorityForAxis:(UILayoutConstraintAxis)axis {

    return [supercontentHuggingPriorityForAxis:axis];

}

 

/** 使其在「內容大小」的基礎上不能繼續變大 */

- (void)setContentHuggingPriority:(UILayoutPriority)priority forAxis:(UILayoutConstraintAxis)axis {

    

}

 

 

- (UILayoutPriority)contentCompressionResistancePriorityForAxis:(UILayoutConstraintAxis)axis {

    return [supercontentCompressionResistancePriorityForAxis:axis];

}

 

/** 使其在在其「內容大小」的基礎上不能繼續變小 */

- (void)setContentCompressionResistancePriority:(UILayoutPriority)priority forAxis:(UILayoutConstraintAxis)axis {

    

}

 

/** 動態計算控件的Size targetSize可傳參數:UILayoutFittingCompressedSize最小狀況下可能的Size UILayoutFittingExpandedSize最大狀況下可能的Size */

- (CGSize)systemLayoutSizeFittingSize:(CGSize)targetSize {

    return [supersystemLayoutSizeFittingSize:targetSize];

}

 

/** 動態計算控件的Size UILayoutPriority優先級 

    horizontalFittingPriority   水平約束優先級

    verticalFittingPriority     垂直約束優先級 */

- (CGSize)systemLayoutSizeFittingSize:(CGSize)targetSize withHorizontalFittingPriority:(UILayoutPriority)horizontalFittingPriority verticalFittingPriority:(UILayoutPriority)verticalFittingPriority {

    return[supersystemLayoutSizeFittingSize:targetSizewithHorizontalFittingPriority:horizontalFittingPriorityverticalFittingPriority:verticalFittingPriority];

}

 

/** 約束檢查爲何這個View 這樣顯返回值 約束條件 */

- (NSArray *)constraintsAffectingLayoutForAxis:(UILayoutConstraintAxis)axis {

    return [superconstraintsAffectingLayoutForAxis:axis];

}

 

/** 判斷當前的自動佈局約束是否還有其餘知足約束的條件 */

- (BOOL)hasAmbiguousLayout {

    return [superhasAmbiguousLayout];

}

 

/** 隨機實現一個知足約束的條件 */

- (void)exerciseAmbiguityInLayout {

    

}

 

#pragma mark - NSCoder

/** 歸檔時編碼 */

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder {

    

}

 

/** 反歸檔時解碼 */

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {

    

}

 

/** 複製一個複合視圖

    afterUpdates    是否視圖展現時才生成視圖

    No              會當即生成快照,並不會調用從新設置顏色的方法無色

    YES             當調用這個視圖時生成

 */

- (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates {

    return [supersnapshotViewAfterScreenUpdates:afterUpdates];

}

 

/** 複製一個指定範圍偏移量的複合視圖 */

- (UIView *)resizableSnapshotViewFromRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates withCapInsets:(UIEdgeInsets)capInsets {

    return[superresizableSnapshotViewFromRect:rectafterScreenUpdates:YESwithCapInsets:capInsets];

}

 

/** 將指定範圍的視圖繪製到圖形上下文中 */

- (BOOL)drawViewHierarchyInRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates {

    return [superdrawViewHierarchyInRect:rect afterScreenUpdates:afterUpdates];

}

6.UIview的屬性:

    (1)backgroundColor

     (2)hidden:布爾類型,是否隱藏視圖

     (3)alpha:cgfloat類型,設置視圖的透明度,0.0-1.0

    (4)opaque:布爾類型,是否爲不透明

    (5)clipsToBounds,布爾類型,是否限制子視圖只能在視圖中顯示

    (6)clearsContextBeforeDrawing:布爾類型,是否在繪製以前自動清除界限bounds

    (7)maskView:uiview類型,經過這個視圖的透明度來遮蓋另外一個視圖的內容

    (8)+ (Class)layerClass:能夠經過這個方法返回一個不一樣類型的視圖圖層

7.和事件接觸有關的行爲:

    (1)userInteractionEnabled:布爾類型,是否容許用戶和視圖進行交互

    (2)multipleTouchEnabled:布爾類型,是否容許視圖可以響應多重接觸事件

    (3)exclusiveTouch:布爾類型,是否讓接受者惟一的響應接觸事件

    (4)- (BOOL)isDescendantOfView:(UIView *)view:返回一個布爾類型,確認這個視圖是不是一個視圖的子視圖

    (5)@property(nonatomicUIViewAutoresizing autoresizingMask,當父視圖的邊界改變的時候子視圖也得從新調整大小

    (6)@property(nonatomicBOOL autoresizesSubviews:是否容許子視圖邊界自動調整

    (7)@property(nonatomicUIViewContentMode contentMode:當邊界改變時該使用哪一種方式調整內容

    (8) - (void)sizeToFit:視圖的大小隨視圖內容的改變而調整

    (9)setNeedsLayout:消除舊的視圖佈局,下一個更新循環到來的時候更新視圖佈局

    (10)- (void)layoutIfNeeded:快速進行自動佈局子視圖

    (11) + (BOOL)requiresConstraintBasedLayout:布爾類型,指定接收者是否以約束爲基礎添加系統的佈局,就是說若是你的約束不完整可使用這個來補全

    (12)@property(nonatomicBOOL translatesAutoresizingMaskIntoConstraints若是爲yes,系統就會建立一系列的約束If this property’s value is YES, the system creates a set of constraints that duplicate the behavior specified by the view’s autoresizing mask.

  8.只讀屬性:

    (1)@property(readonlystrongNSLayoutYAxisAnchor *bottomAnchor:Use this anchor to create constraints with the view’s bottom edge. You can combine this anchor only with other NSLayoutYAxisAnchor anchors. For more information, see NSLayoutAnchor Class Reference.

    (2)@property(readonlystrongNSLayoutXAxisAnchor *centerXAnchor:可使用這個錨點建立視圖水平中心的約束

    (3)@property(readonlystrongNSLayoutYAxisAnchor *centerYAnchor:可使用這個錨點建立垂直中心的約束

    (4)@property(readonlystrongNSLayoutYAxisAnchor *firstBaselineAnchor:For views with multiple lines of text, this anchor represents the baseline of the top row of text. Use this anchor to create constraints with this baseline.

    (5)@property(readonlystrongNSLayoutDimension *heightAnchor:可使用這個錨點建立視圖高度的約束

    (6)@property(readonlystrongNSLayoutYAxisAnchor *lastBaselineAnchor:For views with multiple lines of text, this anchor represents the baseline of the bottom row of text. Use this anchor to create constraints with this baseline

    (7)@property(readonlystrongNSLayoutXAxisAnchor *leadingAnchor可使用這個錨點建立對齊邊緣

    (8)@property(readonlystrongNSLayoutXAxisAnchor *leftAnchor:可使用這個錨點建立左邊緣的約束

    (9)@property(readonlystrongNSLayoutXAxisAnchor *rightAnchor:建立右邊緣的約束

    (10)@property(readonlystrongNSLayoutYAxisAnchor *topAnchor:建立頂邊緣的約束

    (11)@property(readonlystrongNSLayoutXAxisAnchor *trailingAnchor:建立視圖尾部的約束

    (12)@property(readonlystrongNSLayoutDimension *widthAnchor:建立視圖寬度的約束

    

9.管理視圖的約束:

    (1)@property(nonatomicreadonlyNSArray <__kindof NSLayoutConstraint *> *constraints:讀取視圖的約束

    (2)- (void)addConstraint:(NSLayoutConstraint *)constraint:爲視圖或者子視圖添加一個約束

    (3)- (void)addConstraints:(NSArray<__kindofNSLayoutConstraint *> *)constraints:爲視圖或者子視圖添加約束組

    (4)- (void)removeConstraint:(NSLayoutConstraint *)constraint:刪除約束

    (5)- (void)removeConstraints:(NSArray<__kindofNSLayoutConstraint *> *)constraints刪除約束組

  10.使用佈局指引

    (1)- (void)addLayoutGuide:(UILayoutGuide *)layoutGuide添加布局指引

    (2)@property(nonatomicreadonlycopyNSArray <__kindof UILayoutGuide *> *layoutGuides:這個視圖的佈局指引數組,只讀

    (3)@property(readonlystrongUILayoutGuide *layoutMarginsGuide:爲視圖邊緣添加一個邊緣約束,只讀

    (4)@property(nonatomicreadonlystrongUILayoutGuide *readableContentGuide:一個可讀區域的寬

    (5)- (void)removeLayoutGuide:(UILayoutGuide *)layoutGuide:刪除佈局指引

 11.自動佈局:

    (1)- (CGSize)systemLayoutSizeFittingSize:(CGSize)targetSize:參考該視圖全部的約束和子視圖來決定最好的大小

    (2)- (void)invalidateIntrinsicContentSize:Invalidates the view’s intrinsic content size.

    (3)- (UILayoutPriority)contentCompressionResistancePriorityForAxis:(UILayoutConstraintAxis)axis: 

The constraint-based layout system uses these priorities when determining the best layout for views that are encountering constraints that would require them to be smaller than their intrinsic size.

     (4)- (void)setContentHuggingPriority:(UILayoutPriority)priority
                          forAxis:(UILayoutConstraintAxis)axis   : 
Sets the priority with which a view resists being made larger than its intrinsic size.

 12.自動佈局對齊視圖:

    (1)- (CGRect)alignmentRectForFrame:(CGRect)frame: Returns the view’s alignment rectangle for a given frame. 

     (2)- ( CGRect)frameForAlignmentRect:(CGRect)alignmentRect : Returns the view’s frame for a given alignment rectangle
    (3)- (UIEdgeInsets)alignmentRectInsets : Returns the insets from the view’s frame that define its alignment rectangle.
    (4)@property(readonlystrongUIView *viewForFirstBaselineLayout : 返回一個視圖用來知足第一個基線約束
    (5)@property(readonlystrongUIView *viewForLastBaselineLayout:返回一個視圖用來知足最後的基線約束。

13.觸發自動約束

    (1)- (BOOL)needsUpdateConstraints :布爾值類型,決定是否須要要更新視圖的約束

    (2)- (void)setNeedsUpdateConstraints : 方法,控制視圖約束是否須要更新

    (3)- (void)updateConstraints :爲視圖更新約束

    (4)- (void)updateConstraintsIfNeeded : 不管佈局何時被觸發,系統會調用這個方法來更新當前視圖的約束

14.調試自動佈局

    (1)- (BOOL)hasAmbiguousLayout  : yes的話就不徹底指定視圖的位置

    (2)- (void)exerciseAmbiguityInLayout : 這個方法隨機的改變視圖的frame經過一個不肯定的值

    (3)@property(nonatomicUISemanticContentAttribute semanticContentAttribute : 一般用來決定視圖是否可以快速滑動

    (4)+ (UIUserInterfaceLayoutDirection)userInterfaceLayoutDirectionForSemanticContentAttribute:(UISemanticContentAttribute)attribute : 當視圖有子視圖的時候可使用這個方法來決定子視圖是否須要快速翻動

15.配置內容邊緣

    (1)@property(nonatomicUIEdgeInsets layoutMargins :Use this property to specify the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content

    (2)@property(nonatomicBOOL preservesSuperviewLayoutMargins : 當這個屬性的值爲yes 的時候,進行佈局的時候也須要考慮到父視圖的邊緣

    (3)- (void)layoutMarginsDidChange : 通知視圖佈局邊緣發生了改變

16.繪製和更新視圖

    (1)- (void)drawRect:(CGRect)rect : 當你想繪製本身的視圖內容時應該重載這個方法‘

    (2)- (void)setNeedsDisplay : 當你的視圖內容須要重畫的時候能夠重載這個方法,可是這個方法不會當即更新,只有在下一輪的循環到來的時候也就是舊的點再也不用的時候纔會更新

    (3)- (void)setNeedsDisplayInRect:(CGRect)invalidRect : 爲接受者指定的矩形區域進行重畫,當你的視圖內容有某一部分須要重畫的時候能夠重載這個方法

    (4)@property(nonatomicCGFloat contentScaleFactor :就是用這個屬性來改變視圖的大小,例如視圖爲50*50  , 這個屬性值爲2.0 , 最後獲得的視圖爲100*100

    (5)- (void)tintColorDidChange :當tintcolor屬性發生改變的時候就會觸發這個方法

17.格式的打印視圖內容

    (1)- (UIViewPrintFormatter *)viewPrintFormatter : 當初始化一個打印任務時,能夠爲你的視圖調用這個方法獲取合適的視圖打印格式 

     (2)- (void)drawRect:(CGRect)area
forViewPrintFormatter:(UIViewPrintFormatter *)formatter   : 
若是你想要一個視圖的印刷內容出現不一樣於其顯示內容可使用這個方法

18.管理手勢識別器

    (1)- (void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer : 爲視圖添加一個手勢識別器

    (2)- (void)removeGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer : 從視圖中移除有一個手勢識別器

    (3)@property(nonatomiccopyNSArray <__kindof UIGestureRecognizer *> *gestureRecognizers : 當前在視圖中的視圖識別器組成的數組

    (4)- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer :若是爲yes的時候該手勢就應該一直跟蹤接觸事件

19.動畫視圖和塊對象

    (1)+ (void)animateWithDuration:(NSTimeInterval)duration
                      delay:(NSTimeInterval)delay
                    options:(UIViewAnimationOptions)options
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion   

duration

The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

delay

The amount of time (measured in seconds) to wait before beginning the animations. Specify a value of 0 to begin the animations immediately.

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions

animations

A block object containing the changes to commit to the views. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL.

 這個方法是用來初始化一個完整動畫的
    (2)+ ( void)animateWithDuration:(NSTimeInterval)duration
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion
duration

The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

animations

A block object containing the changes to commit to the views. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL.

    (3)+ ( void)animateWithDuration:(NSTimeInterval)duration
                 animations:(void (^)(void))animations
           
duration

The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

animations

A block object containing the changes to commit to the views. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.

    (4)+ ( void)transitionWithView:(UIView *)view
                  duration:(NSTimeInterval)duration
                   options:(UIViewAnimationOptions)options
                animations:(void (^)(void))animations
                completion:(void (^)(BOOL finished))completion
view

The container view that performs the transition.

duration

The duration of the transition animation, measured in seconds. If you specify a negative value or 0, the transition is made without animations.

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions

animations

A block object that contains the changes you want to make to the specified view. This block takes no parameters and has no return value. This parameter must not be NULL.

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL.

 可使用這方法來爲一個指定的視圖容器建立一個轉變更畫
    (5)+ ( void)transitionFromView:(UIView *)fromView
                    toView:(UIView *)toView
                  duration:(NSTimeInterval)duration
                   options:(UIViewAnimationOptions)options
                completion:(void (^)(BOOL finished))completion
fromView

The starting view for the transition. By default, this view is removed from its superview as part of the transition. 

toView

The ending view for the transition. By default, this view is added to the superview of fromView as part of the transition. 

duration

The duration of the transition animation, measured in seconds. If you specify a negative value or 0, the transition is made without animations.

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL.

從一個視圖動畫轉變到另外一個視圖
    (6)+ ( void)animateKeyframesWithDuration:(NSTimeInterval)duration
                               delay:(NSTimeInterval)delay
                             options:(UIViewKeyframeAnimationOptions)options
                          animations:(void (^)(void))animations
                          completion:(void (^)(BOOL finished))completion
uration

The duration of the overall animation, measured in seconds. If you specify a negative value or 0, changes are made immediately and without animations.

delay

Specifies the time (in seconds) to wait before starting the animation. 

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see 「UIViewKeyframeAnimationOptions」

animations

A block object containing the changes to commit to the views. Typically, you call the addKeyframeWithRelativeStartTime:relativeDuration:animations: method one or more times from inside this block. You may also change view values directly if you want those changes to animate over the full duration. This block takes no parameters and has no return value. Do not use a nil value for this parameter.

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. You can use a nil value for this parameter.

建立一個以幀爲基礎的動畫
    (7)+ ( void)addKeyframeWithRelativeStartTime:(double)frameStartTime
                        relativeDuration:(double)frameDuration
                              animations:(void (^)(void))animations
frameStartTime

The time at which to start the specified animations. This value must be in the range 0 to 1, where 0represents the start of the overall animation and 1 represents the end of the overall animation. For example, for an animation that is two seconds in duration, specifying a start time of 0.5 causes the animations to begin executing one second after the start of the overall animation.

frameDuration

The length of time over which to animate to the specified value. This value must be in the range 0 to 1and indicates the amount of time relative to the overall animation length. If you specify a value of 0, any properties you set in the animations block update immediately at the specified start time. If you specify a nonzero value, the properties animate over that amount of time. For example, for an animation that is two seconds in duration, specifying a duration of 0.5 results in an animation duration of one second.

animations

A block object containing the animations you want to perform. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be nil.

在兩個不一樣的值之間進行動畫或者扭曲動畫的時間均可以調用這個方法
    (7)

+ (void)performSystemAnimation:(UISystemAnimation)animation
                       onViews:(NSArray<__kindof UIView *> *)views
                       options:(UIViewAnimationOptions)options
                    animations:(void (^)(void))parallelAnimations
                    completion:(void (^)(BOOL finished))completion

animation

The system animation to perform; a constant from the UISystemAnimation enum.

views

The views to perform the animations on.

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions

parallelAnimations

Additional animations you specify to run alongside the system animation, with the same timing and duration that the system animation defines or inherits.

In your additional animations, do not modify properties of the view on which the system animation is being performed.

completion

A block object to be executed when the animation sequence ends. The single Boolean argument indicates whether or not the animations finished before the completion handler was called. If the animation duration is 0, this block is performed at the beginning of the next run-loop cycle. You can use a nil value for this parameter.

 爲一個或多個視圖執行系統提供的動畫

    (8)+ (void)animateWithDuration:(NSTimeInterval)duration
                      delay:(NSTimeInterval)delay
     usingSpringWithDamping:(CGFloat)dampingRatio
      initialSpringVelocity:(CGFloat)velocity
                    options:(UIViewAnimationOptions)options
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion

duration

The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

delay

The amount of time (measured in seconds) to wait before beginning the animations. Specify a value of 0 to begin the animations immediately.

dampingRatio

The damping ratio for the spring animation as it approaches its quiescent state.

To smoothly decelerate the animation without oscillation, use a value of 1. Employ a damping ratio closer to zero to increase oscillation.

velocity

The initial spring velocity. For smooth start to the animation, match this value to the view’s velocity as it was prior to attachment.

A value of 1 corresponds to the total animation distance traversed in one second. For example, if the total animation distance is 200 points and you want the start of the animation to match a view velocity of 100 pt/s, use a value of 0.5.

options

A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions

animations

A block object containing the changes to commit to the views. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.

completion

A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL.

 使用物理動畫彈跳來顯示動畫
    (9)+ ( void)performWithoutAnimation:(void (^)(void))actionsWithoutAnimation    : 視圖禁用一個動畫過渡
20.動畫視圖:
    (1)+ (void)beginAnimations:(NSString *)animationID
                context:(void *)context 
animationID

An application-supplied identifier for the animations.

context

Custom data that you want to associate with this set of animations. information that is passed to the animation delegate messages—the selectors set using the setAnimationWillStartSelector: and setAnimationDidStopSelector: methods.

 執行一個或多個動畫
    (2)+ ( void)commitAnimations :If the current animation set is the outermost set, this method starts the animations when the application returns to the run loop.
    (3)+ (void)setAnimationStartDate:(NSDate *)startTime :爲當前的動畫設置開始的時間
    (4)+ (void)setAnimationsEnabled:(BOOL)enabled ; yes的時候動畫可使用,no的時候動畫不可使用
    (5)+ (void)setAnimationDelegate:(id)delegate ; 指定一個委託在你接受信息的時候開始或者結束動畫
    (6)+ (void)setAnimationWillStartSelector:(SEL)selector ; 當動畫開始的時候設置消息發送給動畫委託
    (7)+ (void)setAnimationDidStopSelector:(SEL)selector ; 當動畫結束的時候設置消息發送給動畫委託
    (8)+ (void)setAnimationDuration:(NSTimeInterval)duration:設置動畫執行的時間長度
    (9)+ (void)setAnimationDelay:(NSTimeInterval)delay ;設置多長時間後開始執行動畫
    (10)+ (void)setAnimationCurve:(UIViewAnimationCurve)curve設置使用的曲線當動畫屬性改變的時候
    (11)+ (void)setAnimationRepeatCount:(float)repeatCount ; 設置動畫重複的時間
    (12)+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses ; 設置動畫是否能夠反方向重複
    (13)+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState ;設置視圖是否應該從當前的狀態開始執行動畫
    (14)+ (void)setAnimationTransition:(UIViewAnimationTransition)transition
                       forView:(UIView *)view
                         cache:(BOOL)cache
transition

A transition to apply to view. Possible values are described in UIViewAnimationTransition.

view

The view to apply the transition to.

cache

If YES, the before and after images of view are rendered once and used to create the frames in the animation. Caching can improve performance but if you set this parameter to YES, you must not update the view or its subviews during the transition. Updating the view and its subviews may interfere with the caching behaviors and cause the view contents to be rendered incorrectly (or in the wrong location) during the animation. You must wait until the transition ends to update the view.

If NO, the view and its contents must be updated for each frame of the transition animation, which may noticeably affect the frame rate.

解釋:If you want to change the appearance of a view during a transition—for example, flip from one view to another—then use a container view, an instance of  UIView,
    (15)+ ( BOOL)areAnimationsEnabled ;返回一個布爾值,指定動畫是否能夠執行
21.使用動做功能
    (1)- (void)addMotionEffect:(UIMotionEffect *)effect ; 爲視圖添加一個動做功能
    (2)@property(copynonatomicNSArray <__kindof UIMotionEffect *> *motionEffects ; 獲取視圖的動做數組
    (3)- (void)removeMotionEffect:(UIMotionEffect *)effect ;移除動做功能
22.恢復和存儲狀態:
    (1)@property(nonatomiccopyNSString *restorationIdentifier ; 這個標示決定視圖是否能夠保存和恢復狀態
    (2)- (void)encodeRestorableStateWithCoder:(NSCoder *)coder ;若是你的軟件支持恢復功能,能夠爲視圖重載這個方法編碼相關狀態
    (3)- (void)decodeRestorableStateWithCoder:(NSCoder *)coder ;從視圖解碼和保存狀態關係信息
23.配置一個快照
    (1)- (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates ; 在基於當前內容中返回一個快照視圖
    (2)- (UIView *)resizableSnapshotViewFromRect:(CGRect)rect
                       afterScreenUpdates:(BOOL)afterUpdates
                            withCapInsets:(UIEdgeInsets)capInsets
rect

The portion of the view that you want to capture. The rectangle must be in the bounds coordinate space of the current view.

afterUpdates

A Boolean value that specifies whether the snapshot should be taken after recent changes have been incorporated. Pass the value NO if you want to capture the screen in its current state, which might not include recent changes.

capInsets

The edge insets that define the stretchable portion of the returned view’s content. You can specify UIEdgeInsetsZero if you do not want the contents of the returned view to have a stretchable area.

 得到當前視圖內容的快照,而且對快照進行編輯,可編輯的內容爲到邊界的距離
    (3)- ( BOOL)drawViewHierarchyInRect:(CGRect)rect
             afterScreenUpdates:(BOOL)afterUpdates
rect

A rectangle specified in the local coordinate system (bounds) of the view.

afterUpdates

A Boolean value that indicates whether the snapshot should be rendered after recent changes have been incorporated. Specify the value NO if you want to render a snapshot in the view hierarchy’s current state, which might not include recent changes.

當你想要應用一個圖形功能的時候可使用這個方法
23.在運行期間標示視圖
    (1) @property(nonatomicNSInteger tag : 用一個數值來標識一個視圖
    (2)- (__kindof UIView *)viewWithTag:(NSInteger)tag ; 返回一個特定標識的視圖
24.轉換兩個視圖之間的座標系統:
    (1)

- (CGPoint)convertPoint:(CGPoint)point
                 toView:(UIView *)view

point

A point specified in the local coordinate system (bounds) of the receiver.

view

The view into whose coordinate system point is to be converted. If view is nil, this method instead converts to window base coordinates. Otherwise, both view and the receiver must belong to the same UIWindow object.

 轉換接收者座標系統中的點到指定的視圖

    (2)- (CGPoint)convertPoint:(CGPoint)point
               fromView:(UIView *)view

point

A point specified in the local coordinate system (bounds) of view.

view

The view with point in its coordinate system. If view is nil, this method instead converts from window base coordinates. Otherwise, both view and the receiver must belong to the same UIWindow object.    

   從一個視圖座標系統中轉換一個點到接收者座標系統中
    (3)- ( CGRect)convertRect:(CGRect)rect
               toView:(UIView *)view
rect

A rectangle specified in the local coordinate system (bounds) of the receiver.

view

The view that is the target of the conversion operation. If view is nil, this method instead converts to window base coordinates. Otherwise, both view and the receiver must belong to the same UIWindow object.

 從接收者系統中轉換一個矩形到指定的視圖座標系統中
    (4)- ( CGRect)convertRect:(CGRect)rect
             fromView:(UIView *)view
rect

A rectangle specified in the local coordinate system (bounds) of view.

view

The view with rect in its coordinate system. If view is nil, this method instead converts from window base coordinates. Otherwise, both view and the receiver must belong to the same UIWindow object.  

從一個視圖轉換一個矩形到接收者座標系統中
25.測試視圖
    (1)- ( UIView *)hitTest:(CGPoint)point
          withEvent:(UIEvent *)event
point

A point specified in the receiver’s local coordinate system (bounds). 

event

The event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nil.

  返回響應鏈中能夠接受某個點觸發的事件的視圖
     (2)- ( BOOL)pointInside:(CGPoint)point
          withEvent:(UIEvent *)event
point

A point that is in the receiver’s local coordinate system (bounds).

event

The event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nil.

若是點在接受者的邊界內部返回yes
    (3)- ( BOOL)endEditing:(BOOL)force ,從當前視圖或者子視圖中尋找文本的響應,若是爲第一響應者就放棄這個響應,若是force爲yes那麼這個文本將會永遠不會獲得第一響應
26.觀察視圖相關的改變
    (1)- (void)didAddSubview:(UIView *)subview ; 這個方法主要用來重載,並告訴視圖子視圖已經添加
    (2)- (void)willRemoveSubview:(UIView *)subview ; 用來重載的時候告訴視圖子視圖已經刪除
    (3)- (void)willMoveToSuperview:(UIView *)newSuperview ; 用來重載的時候肯定將會在何時改變父視圖
    (4)- (void)didMoveToSuperview ; 重載的時候告訴視圖已經轉移到其餘的父視圖
    (5)- (void)willMoveToWindow:(UIWindow *)newWindow ; 重載時候轉移到新的窗口
    (6)- (void)didMoveToWindow ; 重載的時候告訴視圖已經移動到窗口
27.觀察聚焦
    (1)- (BOOL)canBecomeFocused ; 詢問視圖是否能夠成爲當前成爲焦點的可能
    (2)+ (NSTimeInterval)inheritedAnimationDuration ;返回the inherited duration of the current animation.
    (3)@property(readonlynonatomicgetter=isFocusedBOOL focused ; 指定這個項目是否當前被關注
28.數據類型
    
    UIViewAnimationOptions的類型:
UIViewAnimationOptionLayoutSubviews = 1 << 0, :  Lay out subviews at commit time so that they are animated along with their parent. 
UIViewAnimationOptionAllowUserInteraction = 1 << 1,  動畫容許和用戶相交互
UIViewAnimationOptionBeginFromCurrentState = 1 << 2,  : 從當前的設置狀態開始動畫
UIViewAnimationOptionRepeat = 1 << 3,  :無限循環動畫
UIViewAnimationOptionAutoreverse = 1 << 4,   : 使動畫向前播放和向後播放都須要使用這個
UIViewAnimationOptionOverrideInheritedDuration = 1 << 5,  : Force the animation to use the original duration value specified when the animation was submitted.
UIViewAnimationOptionOverrideInheritedCurve = 1 << 6,  :Force the animation to use the original curve value specified when the animation was submitted
UIViewAnimationOptionAllowAnimatedContent = 1 << 7,  : 動畫視圖經過改變這個值來重畫視圖
UIViewAnimationOptionShowHideTransitionViews = 1 << 8, :當執行轉換視圖時這個視圖會被隱藏或者顯示
UIViewAnimationOptionOverrideInheritedOptions = 1 << 9, :選擇不繼承動畫類型或任何選項。
UIViewAnimationOptionCurveEaseInOut = 0 << 16,  :動畫使用高斯曲線,就是s形的
UIViewAnimationOptionCurveEaseIn = 1 << 16,  :一開始是慢而後慢慢變快的曲線,遞增曲線
UIViewAnimationOptionCurveEaseOut = 2 << 16,  :一開始很快慢慢變慢的曲線,遞增曲線
UIViewAnimationOptionCurveLinear = 3 << 16,  : 線性動畫曲線,動畫發生的時間都是均勻的
UIViewAnimationOptionTransitionNone = 0 << 20,  :沒有轉換效果
UIViewAnimationOptionTransitionFlipFromLeft = 1 << 20,  以垂直爲中心,視圖從左向右轉,就像酒店的旋轉門
UIViewAnimationOptionTransitionFlipFromRight = 2 << 20,  :以垂直爲中心,視圖從右向左旋轉,就像酒店的旋轉門
UIViewAnimationOptionTransitionCurlUp = 3 << 20,  :從下面向上面捲動
UIViewAnimationOptionTransitionCurlDown = 4 << 20,  :從上面向下面捲動
UIViewAnimationOptionTransitionCrossDissolve = 5 << 20,  :一個視圖以溶解的形式向另外一個視圖進行轉換
UIViewAnimationOptionTransitionFlipFromTop = 6 << 20,  :以中心水平爲軸,從上面向下面旋轉
UIViewAnimationOptionTransitionFlipFromBottom = 7 << 20,  :以水平中心軸爲軸,從下面向上面旋轉
 
 
2. UIViewContentMode類型:
UIViewContentModeScaleToFill,  :The option to scale the content to fit the size of itself by changing the aspect ratio of the content if necessary
UIViewContentModeScaleAspectFit,  :The option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent. 
UIViewContentModeScaleAspectFill,  :按照內容的比例填滿視圖,有一部份內容可能會跑出視圖的範圍
UIViewContentModeRedraw,  : 經過使用setNeedsDisplay方法能夠重畫視圖
UIViewContentModeCenter,  :保持內容在視圖的中心
UIViewContentModeTop,  :保持內容在頂部
UIViewContentModeBottom,  :保持內容在底部
UIViewContentModeLeft,  :保持內容在左邊
UIViewContentModeRight,  :保持內容在右邊
UIViewContentModeTopLeft,  :保持內容在左上方
UIViewContentModeTopRight, :保持內容在右上方
UIViewContentModeBottomLeft,   :保持內容在左下面
UIViewContentModeBottomRight,  :保持內容在右下面
 
UIViewTintAdjustmentModeAutomatic,   :色彩調整模式是它的父視圖的色彩調整模式(或UIViewTintAdjustmentModeNormal若是視圖沒有父視圖)。
UIViewTintAdjustmentModeNormal,  :返回視圖沒有更改的色彩
UIViewTintAdjustmentModeDimmed,  :返回一個減少飽和度或者說是暗淡的顏色
 
4.UISystemAnimation的類型:
UISystemAnimationDelete,  :當動畫被執行的時候把視圖從視圖鏈中刪除
 
5. UIViewAutoresizing的類型:
UIViewAutoresizingNone = 0,  :指定視圖不調整大小
UIViewAutoresizingFlexibleLeftMargin = 1 << 0,   :從左邊緣進行放大或者縮小進行調整大小
UIViewAutoresizingFlexibleWidth = 1 << 1,  :經過放大或者縮小寬度來調整大小
UIViewAutoresizingFlexibleRightMargin = 1 << 2,  :經過從右邊緣進行放大或者縮小來進行調整大小
UIViewAutoresizingFlexibleTopMargin = 1 << 3,  :經過從上邊緣進行放大或者縮小來進行調整大小
UIViewAutoresizingFlexibleHeight = 1 << 4,  :經過從高度進行放大或者縮小來調整大小
UIViewAutoresizingFlexibleBottomMargin = 1 << 5  :經過底部邊緣進行放大或者縮小來調整大小
 
UIViewAnimationTransitionNone,  :沒有指定的動畫轉換
UIViewAnimationTransitionFlipFromLeft,  :從左向右翻轉
UIViewAnimationTransitionFlipFromRight,  :從右向左翻轉
UIViewAnimationTransitionCurlUp,  :向上翻轉
UIViewAnimationTransitionCurlDown,  :向下翻轉
 
UIViewKeyframeAnimationOptionLayoutSubviews = UIViewAnimationOptionLayoutSubviews,  :會跟着父視圖進行動畫
UIViewKeyframeAnimationOptionAllowUserInteraction = UIViewAnimationOptionAllowUserInteraction,  :當進行動畫的時候容許進行交互
UIViewKeyframeAnimationOptionBeginFromCurrentState = UIViewAnimationOptionBeginFromCurrentState,  :從當前的狀態進行動畫
UIViewKeyframeAnimationOptionRepeat = UIViewAnimationOptionRepeat,  :無限重複動畫
UIViewKeyframeAnimationOptionAutoreverse = UIViewAnimationOptionAutoreverse,  :使動畫能夠向前播放也能夠向後播放,可是須要聯合UIViewKeyframeAnimationOptionRepeat使用
UIViewKeyframeAnimationOptionOverrideInheritedDuration = UIViewAnimationOptionOverrideInheritedDuration,  :The option to force an animation to use the original duration value specified when the animation was submitted 
UIViewKeyframeAnimationOptionOverrideInheritedOptions = UIViewAnimationOptionOverrideInheritedOptions,  :這個選項沒有繼承動畫類型或者任何的選項
UIViewKeyframeAnimationOptionCalculationModeLinear = 0 << 9,  :The option to use a simple linear calculation when interpolating between keyframe values.
UIViewKeyframeAnimationOptionCalculationModeDiscrete = 1 << 9,  :The option to not interpolate between keyframe values, but rather to jump directly to each new keyframe value.
UIViewKeyframeAnimationOptionCalculationModePaced = 2 << 9,  :The option to compute intermediate keyframe values using a simple pacing algorithm. This option results in an evenly paced animation.
UIViewKeyframeAnimationOptionCalculationModeCubic = 3 << 9,  :The option to compute intermediate frames using a default Catmull-Rom spline that passes through the keyframe values. You cannot adjust the parameters of this algorithm.
UIViewKeyframeAnimationOptionCalculationModeCubicPaced = 4 << 9  :The option to compute intermediate frames using the cubic scheme while ignoring the timing properties of the animation. Instead, timing parameters are calculated implicitly to give the animation a constant velocity.
 
8. UILayoutConstraintAxis的類型:
UILayoutConstraintAxisHorizontal = 0,  :當佈局對象之間的水平約束的時候這個約束就會被使用
UILayoutConstraintAxisVertical = 1  :當佈局對象之間的垂直約束的時候這個約束就會被使用
 

const CGSize UILayoutFittingCompressedSize;  :這個選項儘量的使用最小的尺寸

const CGSize UILayoutFittingExpandedSize;  :這個選項儘量的使用最大的尺寸

 

10.UISemanticContentAttribute的類型:

UISemanticContentAttributeUnspecified = 0,  :The view is flipped when switching between left-to-right and right-to-left layouts

UISemanticContentAttributePlayback,  :A view representing the playback controls, such as Play, Rewind, or Fast Forward buttons or playhead scrubbers

UISemanticContentAttributeSpatial,  :A view representing a directional control, such as a segment control for text alignment, or a D-pad control for a game.

UISemanticContentAttributeForceLeftToRight,  :視圖老是從左向右佈局

UISemanticContentAttributeForceRightToLeft  :視圖老是從右向左佈局

相關文章
相關標籤/搜索