Questions tagged [ios-animations]

Animations provide fluid visual transitions between different states of your user interface.

Animations

Animations provide fluid visual transitions between different states of your user interface. In iOS, animations are used extensively to reposition views, change their size, remove them from view hierarchies, and hide them. You might use animations to convey feedback to the user or to implement interesting visual effects.

In iOS, creating sophisticated animations does not require you to write any drawing code. All of the animation techniques described in this chapter use the built-in support provided by Core Animation. All you have to do is trigger the animation and let Core Animation handle the rendering of individual frames. This makes creating sophisticated animations very easy with only a few lines of code.

Official Documentation

188 questions
0
votes
1 answer

Animate UIButton back to its original position swift IOS

I have wriiten following code to animate my button UIView.animate(withDuration: 1.0, animations: { assistButton.frame = CGRect(x: self.view.frame.maxX - 75, y: self.view.frame.maxY - 120, width: width, height: height) }) This code…
amodkanthe
  • 4,345
  • 6
  • 36
  • 77
0
votes
0 answers

How to achieve similar transition?

So here is the example I’m trying to recreate. Top section is UICollectionView I believe. But I am confused by lower rows transition. So what is the easiest way to implement the same transition animation? Is it custom reload row animation or…
0
votes
0 answers

UIView hidden animations not work at iOS 12

Here is the code - (void)viewDidLoad { [super viewDidLoad]; UIView *testView1 = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; UIView *testView2 = [[UIView alloc] initWithFrame:CGRectMake(100, 200, 100, 100)]; …
刘俊利
  • 358
  • 4
  • 12
0
votes
1 answer

How to use perform(aSelector: , with: , afterDelay: , inModes: ) to pause a CABasicAnimation after a delay

I am using perform(aSelector: , with: , afterDelay: , inModes: ) to pause an animation after a specified delay. However, I keep getting an Unrecognized Selector Error. I am not sure what could possibly be causing this. Sample Code (Updated): …
wizeOnes
  • 119
  • 16
0
votes
2 answers

Animate view borders with custom UIBezierPath

I'm trying to make an app with chat "bubbles" and I need to animate a transition between each bubble state. extension UIView { func makeRoundedCorners(topLeftRad: Double, topRightRad: Double, bottomRightRad: Double, bottomLeftRad: Double) { …
0
votes
1 answer

definesPresentationContext = true in container view still allows modal animations over background views

In my code I am using the present(:animated:completion:) method to present ViewController2 from ViewController1 that is the root view controller of a container view nested within RootViewController. I've set the presentation style to be…
Brinkster
  • 182
  • 1
  • 11
0
votes
1 answer

CAAnimation is overriding previous CAAnimation animation

I have one this scenario: I add to a layer CAAnimation that transforms it to a specific frame. with a starting time of 0. Then I add another CAAnimation that transforms it to a different frame. with a starting time of 0.5. what happens is that the…
shannoga
  • 19,649
  • 20
  • 104
  • 169
0
votes
1 answer

Drawing a dismiss transition beneath the TabBar in Swift 4

I'm trying to implement CardViews similar to the ones used in the iOS 11 App Store. In order to do so, I'm using a GitHub project (https://github.com/PaoloCuscela/Cards) and tweaked it a bit. The problem is that when transitioning back from the…
Medwe
  • 318
  • 1
  • 12
0
votes
1 answer

Swift: Fading two images while chaging frame

Can someone tell me how can I animate a cross dissolve transition while chaging the initial frame? My code: self.image = initialImage UIView.transition(with: _self, duration: 10.0, options: [.transitionCrossDissolve, .allowUserInteraction],…
0
votes
0 answers

I'm trying to animate a text view's position and height but the height just gets set and the position animates

I'm trying to animate an instance of UITextView to expand and collapse some text but what happens is that the text view gets resized with a new height right away and its position animates. Ideally I'd want both properties to animate for smoother…
MichaelGofron
  • 1,310
  • 4
  • 15
  • 29
0
votes
1 answer

Swift custom animations progress

I'm looking for some 3rd party or code snippets for implementation of the custom animations like this one: https://drive.google.com/open?id=1nwmkBgHYUFGR_rrn9aM6S1CrSLpOb6Jb (take a look at the top bar of progress animations) I am not strong in…
Oleg Novosad
  • 2,261
  • 1
  • 27
  • 28
0
votes
2 answers

How can I animate the frame and alpha of a UIButton's titleLabel simultaneously?

I would like animate the width and alpha of my UIButton's titleLabel. The alpha animation should start after 1 second. I'm trying to do it with Core Animation: let animSize = CAKeyframeAnimation(keyPath: "bounds") animSize.values =…
adam_
  • 25
  • 2
0
votes
1 answer

Insert table cell animation with big cells

someone could help me with the animation? My final objetive is to show details of a cell, I tried: fixed height, replace the cell with another and insert the new cell bellow the touched cell. All solutions have similar problems with the animation.…
0
votes
1 answer

How to animate letters/words on screen in different ways

I know How to use/show animated images in ImageView. But I m wondering if this is possible in native iOS and/Or Android that letters of a string can be shown on screen via different shape of animations. For Example: Ballons on the full app screen…
M Zubair Shamshad
  • 2,741
  • 3
  • 23
  • 45
0
votes
1 answer

UISwitch broken on / off animation while animating 'onTintColor'

I want to animate the 'on' color of a UISwitch AND keep it interactable, with no compromise to it's on / off animation. Here's what I tried: UIView's animate with duration method doesn't work because well...it shouldn't, 'onTintColor' isn't listed…