首页 > 移动平台 > 详细

iOS中willMoveToSuperview:方法

时间:2015-04-27 18:21:28      阅读:5154      评论:0      收藏:0      [点我收藏+]

直接看代码:

#import "CMoveView.h"

@interface CMoveView ()

//记录上一次父视图

@property (nonatomic, strong) UIView* oldSuperview;

@end

@implementation CMoveView

 

//当自己重写一个UIView的时候有可能用到这个方法,当本视图的父类视图改变的时候,系统会自动的执行这个方法.newSuperview是本视图的新父类视图.newSuperview有可能是nil.

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

    [super willMoveToSuperview:newSuperview];

    NSLog(@"oldSuperview=%@,newSuperview=%@",self.oldSuperview,newSuperview);

      self.oldSuperview = newSuperview;

    NSLog(@"%s",__func__);

}

@end

iOS中willMoveToSuperview:方法

原文:http://www.cnblogs.com/iOS771722918/p/4460744.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!