IPhone playback "slide effect"

I would achieve this when you request something in your application (for example, pressing a button or something else), I would like it to appear in a small rectangle that says β€œloading ..”, and when the download is complete, it disappears using the "slide effect". I made simple layouts to describe what I am trying to achieve. Do you have any hint on me? Thanks.

enter image description here

NOTE: I do not want the update effect (the download view is displayed without scrolling the screen, it appears, for example, when sending a comment)

UPDATE:

I tried the Cirrostratus code:

- (IBAction)displayLoadingScreen:(id)sender { NSLog(@"pressed"); UIView *loadingView = [[UIView alloc] init]; loadingView.frame = CGRectMake(0,-40,320,40); [loadingView setBackgroundColor:[UIColor blueColor]]; [self.view addSubview:loadingView]; //animate in within some method called when loading starts [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,0,320,40); } completion:^(BOOL finished) { }]; for (int i = 0; i < 10000; i++) { NSLog(@"%d", i); } //animate out within some method called when loading ends [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,-40,320,40); } completion:^(BOOL finished){ }]; } 

Why does the boot look slide in after the for loop? If you try it, before it prints a for loop and performs two animations. Ideas?

UPDATE 2

 - (void)stopLoading { [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,-40,320,40); } completion:^(BOOL finished){ }]; } - (void)startLoading { loadingView.frame = CGRectMake(0,-40,320,40); [loadingView setBackgroundColor:[UIColor blueColor]]; [self.view addSubview:loadingView]; //animate in within some method called when loading starts [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,0,320,40); } completion:^(BOOL finished) { }]; sleep(5); [self stopLoading]; } - (IBAction)displayLoadingScreen:(id)sender { NSLog(@"button pressed"); [self startLoading]; } 
+4
source share
3 answers
 loadingView.frame = CGRectMake(0,-40,320,40); [loadingView setBackgroundColor:[UIColor blueColor]]; [self.view addSubview:loadingView]; //animate in within some method called when loading starts [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,0,320,40); } completion:^(BOOL finished){ }]; //animate out within some method called when loading ends [UIView animateWithDuration:1.0 animations:^{ loadingView.frame = CGRectMake(0,-40,320,40); } completion:^(BOOL finished){ }]; 
+5
source

What I would do is add a view in front of your other views with the desired download design.

Then, when the download is complete (use a notification or just call the view function), copy it using this animation:

 [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ //change the frame to make the view go out of the screen } completion:^(BOOL finished){ //do whatever you want with the view (release it for instance) }]; 
+1
source

you can do this with the spinner else, which you just view and set the animation with its coordinate, when you click on any object that will be displayed on your screen, and after the download is complete, you should set the "-" coordinate (frame) for your pop-up review, it will hekp you ......

0
source

Source: https://habr.com/ru/post/1379414/


All Articles