m4n*_*n1c -4
创建一个 UIView 类别,它可以帮助复制视图。像这样的东西:
- (id) copyView {
UIView *a = [[UIView alloc]init];
a.frame = self.frame;
//set all other properties of the UIView
return a; //return [a autorelease] if not using ARC
}
Run Code Online (Sandbox Code Playgroud)