Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)fadeOutIn:(UIView *)view duration:(NSTimeInterval)duration
- {
- static CGFloat alpha = 1.0;
- [UIView animateWithDuration:duration
- delay:0.0
- options: UIViewAnimationOptionRepeat| UIViewAnimationOptionCurveEaseInOut
- animations:^{
- alpha = abs((int)(alpha - 1.0));
- view.alpha = alpha;
- }
- completion:^(BOOL finished){
- }];
- }
- -(void)fadeOutIn:(UIView *)view duration:(NSTimeInterval)duration
- {
- [UIView animateWithDuration:duration
- delay:0.0
- options: UIViewAnimationOptionRepeat| UIViewAnimationOptionCurveEaseInOut
- animations:^{
- view.alpha = 0.0;
- }
- completion:^(BOOL finished){
- [UIView animateWithDuration:duration
- delay:0.0
- options: UIViewAnimationOptionRepeat|UIViewAnimationOptionCurveEaseInOut
- animations:^{
- view.alpha = 1.0;
- }
- completion:^(BOOL finished){
- }];
- }];
- }
- [UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{
- self.customIV.alpha = 0;
- } completion:^(BOOL finished) {
- }];
- -(void)fadeOutIn
- {
- [UIView animateWithDuration:1
- delay:0.0
- options: UIViewAnimationOptionCurveEaseInOut
- animations:^{
- [[self contentView] emailField].alpha = 0.0;
- }
- completion:^(BOOL finished){
- [UIView animateWithDuration:1
- delay:0.0
- options: UIViewAnimationOptionCurveEaseInOut
- animations:^{
- [[self contentView] emailField].alpha = 1.0;
- }
- completion:^(BOOL finished){
- [self fadeOutIn];
- }];
- }];
- }
- [UIView animateWithDuration:duration
- delay:0.0
- options: UIViewAnimationOptionRepeat| UIViewAnimationOptionAutoreverse|UIViewAnimationOptionCurveEaseInOut
- animations:^{
- view.alpha = 0.0;
- }
- completion:nil];
- YourView.alpha = 1;// set the initial value of alpha
- [UIView animateWithDuration:1 delay:0
- options: UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat
- animations:^{
- YourView.alpha = 0; // set the max value of alpha
- } completion:nil];
- UIView.animateKeyframes(withDuration: 1, delay: 0, options: [UIView.KeyframeAnimationOptions(rawValue: UIView.AnimationOptions.repeat.rawValue), UIView.KeyframeAnimationOptions(rawValue: UIView.KeyframeAnimationOptions.RawValue(UIView.AnimationCurve.easeInOut.rawValue)), UIView.KeyframeAnimationOptions(rawValue: UIView.AnimationOptions.autoreverse.rawValue)] , animations: {
- self.logoCenterImageView.alpha = 0
- }) { finished in
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement