iphone - UIView Re-Appear on Screen as it Leaves the Other Side? -


I have a UIView called Clouds It currently runs on the right side of the screen, and a Once all this has been abandoned, it appears again on the left.

How can I reproduce it on the left as the right? So when it starts to move from the right side, the one who disappears only appears on the left.

  - (zero) viewDidoadload {[Super Viewedload]; // Setup an additional after loading the view, usually from a nib Movement = [NSTimer Scheduled Timer With Time Interface: 0.05 Target: Self Selector: @Selector (Moving) User Information: Zero Repeats: Yes]; Cloud Shield = 2; } - (zero) PlatformMowelment {clouds.center = CGPXMake (Cloud Center. X + Clouds Molding, Cloud Center). } - Runs (zero) {if (cloudss.center.x <11) {clouds.center = CGPointMake (330, cloudss.center.y); } If (clouds.center.x> 330) {clouds.center = CGPointMake (-11, clouds.center.y); } [Self-Proposed Mobilization];  

Any help would be appreciated, thanks!

This sounds a bit unusual to answer your own question, but any other To help beginners, this is the solution I came up with:

Create another UIView (I called this clouds 2). Move this off-screen to the left, and animate it as the original UIView (clouds1). Adjust the number in small amounts, when leaving the entire screen of the image, it appears again on the left. A converyor belt system like

  - (zero) viewDidLoad {[super viewDidoadload]; // Setup an additional after loading the view, usually from a nib Movement = [NSTimer Scheduled Timer With Time Interface: 0.05 Target: Self Selector: @Selector (Moving) User Information: Zero Repeats: Yes]; Cloud Shield = 2; } - (zero) PlatformMowelement {clouds1.center = CGPointMake (Cloud 1. Center X. Cloud Mounting, Clouds 1. Center Y); Clouds2.center = CGPEx (Clouds 2. Center. X + Cloud Mounting, Cloud 1. Center.); } - (zero) moving {if (clouds1.center.x> 470) {clouds1.center = CGPointMake (-150, clouds 1.center.y); } If (clouds 2. Center X> 470) {clouds2.center = CGPointMake (-150, Cloud 2.center.y); } [Self-Proposed Mobilization]; }  

Comments