Reputation: 11
What is the command of delaying an action to fade in an image?
Upvotes: 0
Views: 253
Reputation: 15588
I find the new block-based animation methods on UIView pretty simple to work with:
https://developer.apple.com/documentation/uikit/uiview
You could do something like
UIImageView *yourPic; // assume it exists
yourPic.opacity = 0.0;
[UIView animateWithDuration:1.0 animations:^
{
yourPic.opacity = 1.0;
}
Upvotes: 0
Reputation: 1061
For Delaying the action u can do in AppDelegation, didFinishLaunchingWithOptions
[NSThread sleepForTimeInterval:2];
For Fade in and Fade out of Image. u can use custom methods for Fade and fade out
Better you could see this post http://iosdevelopertips.com/user-interface/fade-transition-fade-images-in-and-out.html
Upvotes: 0
Reputation: 19323
Sounds like you want
+ (void)setAnimationDelay:(NSTimeInterval)delay
Use it like this (non-block based animations):
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:1.5];
myImage.alpha = 1.0;
[UIView commitAnimations];
Upvotes: 0