Questions tagged [uiviewanimation]

There is no default class called UIViewAnimation, this tag refers to methods that perform animation on UIView objects.

includes a number of different ways to perform animations. One of the simplest is to use the animation support in the UIView class.

Prior to iOS 4, the only way to do UIView animation was with beginAnimations:context/commitAnimations. Those methods are discouraged in iOS 4 and later.

For iOS versions greater than 4.0, you should use the new UIView class methods whose names start with animateWithDuration:

1798 questions
9
votes
6 answers

Can't touch during animation (Block Animation)

I have a View with UIButton, UITextField, and a UIImageView for Background. in viewDidLoad i try animate UIImageView from alpha=0 to alpha =1 using block. it's pretty basic, here's the code: [UIView animateWithDuration:1.5 animations:^(void){ …
HelmiB
  • 12,303
  • 5
  • 41
  • 68
9
votes
3 answers

SwiftUI - Sliding Text animation and positioning

On my journey to learn more about SwiftUI, I am still getting confused with positioning my element in a ZStack. The goal is "simple", I wanna have a text that will slide within a defined area if the text is too long. Let's say I have an area of 50px…
Oleg G.
  • 550
  • 5
  • 25
9
votes
2 answers

Page curl & turn effects for iPhone Development

I'm looking for a very simple page turn effect, similar to the one in iBooks BUT much simpler. I only need the page to be turned if the user swipes the screen (so no difficult 'grabbing' the page animations etc. -- simply an animation). Actually,…
n.evermind
  • 11,944
  • 19
  • 78
  • 122
9
votes
3 answers

Change width UIView by animation and center

I have a view and need change width from 100 to 200 by animation. UIView.animate(withDuration: 5 ,animations: { self.backgroundPlaceHolderView.frame.size.width += 200 }) when running this code, my view change width,…
Rasoul Miri
  • 11,234
  • 1
  • 68
  • 78
9
votes
4 answers

Determine springWithDamping and initialSpringVelocity based off from friction and tension

My design team gives us animation parameters using friction and tension. For instance: Has a spring affect (280 tension and 20.5 friction) Over 0.3 seconds Unfortunately, i've always guessed what these values convert to, and eyeball it, if it…
Joshua Hart
  • 772
  • 1
  • 21
  • 31
9
votes
1 answer

Make a button rotate counterclockwise using CGAffineTransform swift 3 syntax?

I'm trying to make a button rotate counterclockwise but for some strange reason it's rotating clockwise. I know the previous way to do it is by M_PI but it's been deprecated for swift 3 and replaced with CGFloat.pi. I've tried: …
SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
9
votes
3 answers

Keyboard Animation Curve as Int

I am trying to get the UIAnimationCurve of the keyboard, if it exists. The code I am using is below: if let kbCurve = userInfo[UIKeyboardAnimationCurveUserInfoKey] as? Int{ animateCurve = UIViewAnimationCurve. } However,…
steventnorris
  • 5,656
  • 23
  • 93
  • 174
9
votes
2 answers

How to animate constraints without calling `layoutIfNeeded`?

Calling [self.view layoutIfNeeded]; in the animation block causes all of its child views to animate. This causes a problem whilst scrolling a UICollectionView because the UICollectionViewCells animates onto the screen. Is there anyway I can stop…
9
votes
1 answer

Auto Layout constraint change does not animate

I was learning the auto layout with animations from the tutorial http://weblog.invasivecode.com/post/42362079291/auto-layout-and-core-animation-auto-layout-was and things were working perfect. When I tried to use this concept in my application,…
BangOperator
  • 4,377
  • 2
  • 24
  • 38
9
votes
1 answer

UIView animateKeyframesWithDuration vs standard animation block animation differ

I recently found some UIView animation code and noticed that it was not using the animateKeyframesWithDuration:delay:options:animations:completion: method correctly and have since been trying to fix it but for some reason the animations are not…
iMaddin
  • 982
  • 1
  • 14
  • 23
8
votes
4 answers

completion block of uiview animate never called if view disappear

i noticed some strange behavior. When i start a animation and change the View (the view will not dismissed!), the completion handler never get called. [UIView animateWithDuration:0.1f delay:0.0f …
bopa
  • 1,105
  • 1
  • 12
  • 20
8
votes
2 answers

UIView Animation Blocks vs CAAnimation

iOS animation experts! What are the pros and cons of each method? I know Apple recommends blocks instead of the old UIView animation methods (UIView beginAnimations, etc), but what about CAAnimation? When would you use one method vs the other? Is…
mjisrawi
  • 7,846
  • 3
  • 24
  • 27
8
votes
1 answer

animation completion called immediately

I have the following animation block: [UIView animateWithDuration:2 animations:^{ [childViewController_.view setAlpha:0]; } completion:^(BOOL finished) { …
LK.
  • 4,499
  • 8
  • 38
  • 48
8
votes
3 answers

Interactive transition not linear

I'm playing around with custom and interactive view controller transistion, with UIPercentDrivenInteractiveTransition. I'm building an app that present a card (other view controller) modally. I've made custom transistions with…
Wiingaard
  • 4,150
  • 4
  • 35
  • 67
8
votes
1 answer

When is it appropriate to use Core Animation over UIView animation in common cases

This is related to a lot of little bugs that might stereotypically be considered minor by one person, but major by another. What I've noticed more and more, is that when using all flavors a UIView animateWithDuration:, it actually modifies things…