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
4
votes
2 answers

UITableView Drag & Drop Outside Table = Crash

The Good My drag & drop function almost works wonderfully. I longPress a cell and it smoothly allows me to move the pressed cell to a new location between two other cells. The table adjusts and the changes save to core data. Great! The Bad My…
Dave G
  • 12,042
  • 7
  • 57
  • 83
4
votes
1 answer

Setting options in animateWithDuration in Swift 2

I am animating a textfield with the following code: UIView.animateWithDuration(0.5, delay: 0.4, options: .Repeat | .Autoreverse | .CurveEaseOut, animations: { self.password.center.x += self.view.bounds.width },…
MortalMan
  • 2,582
  • 3
  • 23
  • 47
4
votes
2 answers

How to add bounce effect to UIView animateWithDuration

I am trying to add a bounce effect to the animation below. Here is my code: [UIView animateWithDuration:1.0 delay:.0 usingSpringWithDamping:0.5 initialSpringVelocity:2.0 …
Eric
  • 3,811
  • 5
  • 15
  • 18
4
votes
3 answers

using UIView animateWithDuration: delay: Xcode

I am trying to use [UIView animateWithDuration:1 delay:2 options:UIViewAnimationOptionCurveEaseIn animations:^{ } completion:^ (BOOL completed) {} ]; however no matter what number I put for the delay, there is no delay. I am trying to have…
user1114881
  • 731
  • 1
  • 12
  • 25
3
votes
2 answers

Smooth expanding UIView animation in Swift

Aim: How can I animate a UIView that I want to expand to fill the whole screen. The UIView needs to expand in smooth, even and balance way while it animates. I have one red square positioned on screen, starts small then expands to fit the screen.…
user4806509
  • 2,925
  • 5
  • 37
  • 72
3
votes
1 answer

Moving a button in swift using animate with duration with constraints and detecting a touch during it

I want to move a button from point A to point B. Point A: leadingConstraint = 120, topConstraint = 400. Point B: leadingConstraint = 120, topConstraint = 200. For my game purpose, I can't use frames. I also want to be able to detect a touch on it…
Anton O.
  • 653
  • 7
  • 27
3
votes
1 answer

How to create complex animation with better performance in iOS?

All the animations mean change of layer.transform or frame properties. There are 2 main questions about performance: I have multiple views which I should animate simultaneously. What is better: to create multiple animateWithDuration blocks or to…
3
votes
3 answers

Incrementing a parameter in UIView.animateWithDuration in Swift

I have an IBOutlet Collection of buttons that I am trying to present on screen sequentially. They all start off screen fine, but as they animate in, I'd like each button to be presented on screen 0.05 seconds after the previous button. I can't…
Nacho
  • 33
  • 2
2
votes
2 answers

Swift Progress View animation makes the bar go further than 100%

When using animations for the ProgressView, it works completely fine if I let the animation run out but if I try to run this code again while the animation is still going, it will add 100% to the current bar and make it go through the bar. Images…
2
votes
1 answer

How do I animate the width of a UIView with a Timer?

I have a view that's set to the width of my view and a timer that gets some point in the future (in the next 5 minutes). My goal is to animate the view's width from the view.width down to 0 I was trying to do UIView.animate(withDuration:…
Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151
2
votes
1 answer

UIView AnimateWithDuration Never Reaches Completion Block

I have this bit of code that I use to switch the root view controller with a nice little animation, it had been working for months... but then randomly stopped working. UIView snapshot = [self.window…
Gukki5
  • 497
  • 6
  • 22
2
votes
2 answers

animateWithDuration one after another

I have a label that is initially positioned at the center of the screen. It currently transitions from the the center to the right end of the screen then autoreverses back to its position. I'd like to have it begin another animateWithDuration so…
theflarenet
  • 642
  • 2
  • 13
  • 27
2
votes
0 answers

Animate a change to the values in a UITextView's textContainerInset

In my application I'm using a custom toolbar (just another UIView) at the top of the screen; it sits above a UITextView. I'm using auto layout. Because I'm using this custom toolbar - I'm doing the following to make the UITextView look correct with…
Gavin Hope
  • 2,173
  • 24
  • 38
2
votes
1 answer

swift animate all added views alpha

I want to animate all views (based on tag) with an alpha change, but I am getting a "cannot assign alpha to view" error. What would be a good way to do this? All the views have an alpha of 0 upon being added as a subview of myCustomView func…
haitham
  • 3,398
  • 6
  • 21
  • 35
2
votes
3 answers

Stop specific UIViewAnimation block - iOS

I have an iOS application which runs a few different UIViewAnimation blocks to animate a few different objects on screen. This all works, but how can I stop ONE of the animation blocks WITHOUT stopping the rest? I have tried using the following…
1
2
3
10 11