I Want to change contents of UIView dynamically without using removeFromSuperView and addSubview.the codes is an image of what I want to do.
int screenWidth = [[UIScreen mainScreen] bounds].size.width;
int screenHeight = [[UIScreen mainScreen]bounds].size.height;
UIView *currentView = [[UIView alloc]initWithFrame:CGRectMake(0,0,screenWidth,screenHeight)];
UIView *nextView = [[UIView alloc]initWithFrame:CGRectMake(0,0,screenWidth,screenHeight)];
[self.view addSubview:currentView];
currentView = nextView;
//when this code run,appearing currentView swap nextView.
[self.view reload];
Definitely. If you want it to look nice, create the “end” view with the attributes you want and use a static transition method:
+transitionFromView:toView:duration:options:completion:.This will remove and add views, as needed, so that you don’t have to call those methods. Otherwise, you can use the
-setHidden:method suggested by janusfidel, in order to hide the view you don’t want to see.