Questions tagged [animatewithduration]

a block-based animation method for the UIView class in iOS, to automatically "tween" animations.

Automatically transitions from the starting state, to the specified ending state, over the specified duration.

Related links

151 questions
0
votes
0 answers

Animation based upon TableView ContentOffset.Y

I'm having some problems with scrollview within TableView to animate correctly. I want the element with the constraints to animate off-screen when dragging down (this doesn't work), and then when let go it springs back to position (this part…
David West
  • 1,550
  • 1
  • 18
  • 31
0
votes
2 answers

How to animate a particular view in View controller

I have a view (View X) in a View Controller and on completion of some task I want to flip that view and show a image view on that location along with flip animation. I am using this code right now but this animates the whole view controller. [UIView…
Kunal Gupta
  • 2,984
  • 31
  • 34
0
votes
1 answer

Why will my label not change location when trying to add additional text field?

So I have a button on my storyboard. When that button is pressed, I want to move a certain label down a little bit and also add a new text field to the screen. Here is the simplified code: UIView.animateWithDuration(0.5, animations: { () -> Void…
user2807654
  • 122
  • 1
  • 1
  • 11
0
votes
2 answers

Swift : Animate width and height of UIButton

Inside of these two functions, I want to animate the button shrinking(gone), then animate it growing(seen). I was able to animate it growing, but not at first have the button shrink. Any help on how to animate a button shrinking? func…
OriginalAlchemist
  • 391
  • 1
  • 7
  • 28
0
votes
1 answer

Objective C Loading Icon on Timer

I have created a loading icon for my application. While the application is loading the map and placing the markers I have a loading icon displaying on the screen rotating. With my current code the loading icon shows, but only rotates when the…
Curtis Boylan
  • 827
  • 1
  • 7
  • 23
0
votes
1 answer

UIView slide transitions, help needed & near-working code

I'm looking to do the following fully programmatically and have some code that ALMOST does it! Goal Transition between two master views, viewOne and viewTwo. 'viewOne' is the initial full-screen view. Transition with a slide of differing direction…
J-Dizzle
  • 4,861
  • 4
  • 40
  • 50
0
votes
1 answer

Swift iOS 8.0 - Animations not working when called inside the function scrollViewDidEndDecelerating()

I have an animation inside a function named animateImages: func animateImagesIn(step: Int){ if step == 0{ let bounds = self.guideView.stepOne.bounds UIView.animateWithDuration(1.0, delay: 0.2, usingSpringWithDamping: 0.2,…
onad
  • 31
  • 3
0
votes
1 answer

UIView.animateWithDuration completes too early when changing view with Tab Bar Controller

I am making a progress bar by increasing the with of a simple image: let progressBar = createProgressBar(width: self.view.frame.width, height: 60.0) let progressBarView = UIImageView(image: progressBar) progressBarView.frame = CGRect(x: 0, y: 140,…
Jambaman
  • 741
  • 9
  • 22
0
votes
0 answers

Swift layoutIfNeeded within animateWithDuration very slow

I am updating a UIView with layoutIfNeeded within an animateWithDuration block, but the duration is taking much longer than what I have coded. Here is the code: func showInfoView() { self.hintConstraint.constant = self.view.frame.height -…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
0
votes
1 answer

Swift UIView frame not properly updating within animateWithDuration

I'm attempting to update a UIView's position using animateWithDuration. When the animation starts occurring, the UIView begins updating, but then the completion makes it jump to the correct position. This is telling me that the setting of the…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
0
votes
1 answer

iOS: Why the animation runs well with CABasicAnimation but looks weird with animateWithDuration?

Here's a simple demo for rotating an image view with animation. class ViewController: UIViewController { @IBOutlet weak var imageView: UIImageView! @IBAction func left() { …
Ken Zhang
  • 1,454
  • 2
  • 13
  • 27
0
votes
1 answer

UIView.animateWithDuration does not work when called from delegate?

I am using the following function to move self.view to the specified x axis: func shiftMainContainer(#targetPosition: CGFloat, completion: ((Bool) -> Void)! = nil) { UIView.animateWithDuration(0.5, delay: 0, usingSpringWithDamping: 0.8,…
Eugene Teh
  • 263
  • 2
  • 3
  • 12
0
votes
2 answers

UIButton Text Animation Not Animating

Upon a button's touchUpInside, it runs a series of code (all data related, none of the code in the main function modifies a view object) and the last thing that code does is call the animation function that I've pasted below. The problem is, the…
Dave G
  • 12,042
  • 7
  • 57
  • 83
0
votes
3 answers

Completion block in (animateWithDuration:animations:completion:) is unpredictably delayed

The code is too huge to post it here. My problem is the following. When I call animateWithDuration:animations:completion: (maybe with options) with duration == 0.3 it doesn't mean that the completion block will be called through the same delay. It…
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
0
votes
2 answers

Nested animation in iOS: combine animated and non-animated code in animateWithDuration?

Nested animation In short the nested animation allows to run 2 independent animations simultaneously. But what to do if I have a complex code which consists of both animated and non-animated code? I mean the following situation: [UIView…
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49