How to animate an object several times with a delay in swift 3?

I want to animate multiple buttons multiple times in succession but when a button is required to animate twice or more, the code doesn't work at all. //function that animates a button func buttonAnimationChain(buttonColor:UIButton, iDelayTime: Int){

Animation without delay (UIView animateWithDuration delay)

We need to show 10 images sequentially with a certain time interval (default images are in hidden = yes and have a tag from 1111 to 1120). The result of the code is the appearance of images all at once, without delay. Animation is made a separate fun

Allow UITapGestureRecognizer in UIAnimations

I'm trying to show a custom view when I receive a notification from parse. This view is showed with an animation and its hidden with another animation. This view also has a uitapgesturerecognizer that needs to be fired when the user taps the view. My

UIView.animateWithDuration does not animate Swift (again)

Note: I've already checked the following stack overflow issues: 27907570, 32229252, 26118141, 31604300 All I am trying to do is fade animate in a view (by alpha) when called by an IBAction attached to a button. Then reverse when a button on the view

Animate UILabel Width with Auto Layout

I'm trying to animate UILabel's width. For some reason animation doesn't work and label changes it's size immediately. I use autolayout. Here is the code from the sample project I wrote to reproduce this. Tap on the button changes trailing constrains

Can not debug disposition constraints

My app is crashing when transitioning some UIViews, and I'm not able to find the cause. I get this error in the logs console of Xcode: 2015-09-23 10:03:43.420 My App[1510:528283] The view hierarchy is not prepared for the constraint: When added to a

delete the view from right to left with animations

I adding view when btw is clicked from left to right and want to remove this view from right to left. Below is my code while adding view from left to right UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil]; lef

Manage multiple cell selection and custom transitions

We use a UICollectionView in this example but the same issue would apply to a UITableView approach. We have a custom animation on the collection view cell when it is selected. It animates the cell out, then we have a UIViewControllerTransitioningDele

How to rotate UIView 45 degrees?

I want to rotate my UIButton by M_PI/4 with animation. Here's my code: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [UIView animateWithDuration:.5 animations:^{ self.closeButton.transform = CGAffineTransformMakeRotation(M_PI

Change the back button in iOS 7 disable swiping to go back

I have an iOS 7 app where I am setting a custom back button like this: UIImage *backButtonImage = [UIImage imageNamed:@"back-button"]; UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; [backButton setImage:backButtonImage forS

UIView do not animate the first time

This code animates my view every time it's run, except for the first time. When the keyboard is displayed or hidden, a UIView is repositioned: [UIView animateWithDuration:0.26 animations:^{ [self setupActiveOverlayViewFrame]; }completion:nil]; -(void

How to automatically switch between viewPager pages

I have an android application that employs a ViewPager with two pages When the activity first displays i would like to present each page in turn to the user so that they know they can swipe between to two views. I have failed to find any docs describ

IOS Animations without a navigation controller

In my app im showing different screen this way: info = [[Info alloc]initWithNibName:@"Info" bundle:nil]; [self.view addSubview:info.view]; Info is a subclass of UIViewController, so i just create it and add it as a subview of the current view. W

Draw a graph on uiview with animation

Hello Everyone, I would like to create a similar view like in the attached image. I can do this easily with the help of UITableView but I also want to draw a graph above of this tableView. I am calculating some data and based upon that data (%), I ha

Chain animations in UIVIEW inside the for loop

I have some problems with animations. Here is what I am trying to do. First I have a for loop where I make some animations of UILabels, for example label1.frame = CGRectMake(xBoard, 5, textWidth, term1Label.frame.size.height); xBoard = xBoard + textW

Animation of UITableViewCells one by one

I am trying animation, where the UITableView is already in place,but the subview (which itself contains the cell's content view) for each of the UITableViewCells is outside the window bounds. It is outside the screen. When the view loads, the cell an

Animate an image view to drag it up

I am attempting to make an image view (logo below) slide upwards by 100 pixels. I am using this code, but nothing happens at all: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:3]; = CGPointMake(, logo

UIView animation does not work as expected

I have two UIImageView filling the view controller, the first is filling the top half, and the second for the bottom half. I set them directly in the storyboard file. In the viewDidLoad method, i am setting code in order to perform animation for the

How can I switch between two UIView?

I'm using two UITextView objects. Each UITextView represents the side of a single card in a flash card application. Just like when using regular flash cards, I want the user to have the ability to flip a card. I am asking how to flip between two UIVi

Show slow transitions when adding an OpenGL view

Facing a really, really weird problem with an OpenGL View we are using in our app to perform some custom animations. As soon as the Open GL View is added into the project, all native View animations slow down. And by slow down I don't mean a drop in

UIView image animation & ldquo; wiggle & rdquo;

I have this insane piece of code. How do I animate this with Core Animation so I have way less code? I have found some code for doing "wiggle" animation but that's in 3D, I just want the view to move side to side, I don't want to animation it bo

Stunning NSTimer fires

I have four NSTimers that work fine. The only problem is that two should fire and then the other two should fire in the middle of the first two. Here is my code: initTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(

Scale a UIView with a gradient

I'm developing an animated column bar chart and i having some trouble. The bars show up with an scale animation. At the beginning all columns have 1 point size and will scale till a predefined height. The point is: I want to draw a gradient into the

UIView Hide / Show with animation

My simple goal is to fade animate hiding and showing functions. Button.hidden = YES; Simple enough. However, is it possible to have it fade out rather than just disappearing? It looks rather unprofessional that way.In iOS 4 and later, there's a way t

Undoing a UIView animation block

The code below shows an animation of a label which contains a status message for the user. If an event happens the label is showing prompt and is slowly disappearing via uiview animation block. - (void)showStatusOnLabelWithString:(NSString *)statusMe

Much faster animation in a real device than in an emulator

I'm animating the change of image on buttons. I have the time set to .6 which animates in the emulator exactly as expected but in iPhone 4S the same animation happens in a blink, not .6 seconds. I've changed the animation duration to be shorter and l