标签:
-(void)addSubView:(UIView *)view;
-(void)bringSubViewToFront:(UIView *)view;
-(void)sendSubViewToBack:(UIView *)view;
-(void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
-(void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
-(void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;
-(void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;
-(void)removeFromSuperview;
-(UIView *)viewWithTag:(NSInteger)tag;
-(CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
-(CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;
-(CGRect)convertRect:(CGRect)rect toView:(UIView *)view;
-(CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;
-(void)setNeedsDisplay;
1.- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
2.- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
3.- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
4.- (void)touchesCancelled:(nullable NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;
以上方法需要自定义view重写,若需要对触摸点到判断(使用)那么重写方法时,在方法体内首先获取触摸点:
1.UITouch *touch = [touches anyObject];
2.CGPoint point = [touch locationInView:self];
1.// 首先需要设置动画头,告诉编译器下面是动画
2.[UIView beginAnimations:nil context:nil];
3.// 再设置动画执行的配置、动画
4.[UIView setAnimationDuration:0.5];
5.[UIView setAnimationRepeatCount:2];
6.[UIView setAnimationDelay:3.0];
7.// balabala需要执行的动画
8. ................
9.// 最后提交动画
10.[UIView commitAnimations];
+(void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations;
+(void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^ __nullable)(BOOL finished))completion
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^ __nullable)(BOOL finished))completion
标签:
原文地址:http://www.cnblogs.com/buakaw/p/5069287.html