Questions tagged [swiftui-animation]

228 questions
0
votes
0 answers

SwiftUI, prevent the subview to inherit parent's animation

I've been playing with the NavigationPath for some time. I first figured that when a view is inserted into the path (full code is on this answer), the inserted page doesn't have standard navigation transition animation so, I've decided to force one…
0
votes
1 answer

Animation is flickering in few iPhone devices

The animation is working fine for most users but it's flickering for a few. This is how it's flickering and how it should idly look: Here's the code: ZStack { Circle() .fill(Color.white.opacity(0.6)) …
Shunan
  • 3,165
  • 6
  • 28
  • 48
0
votes
0 answers

SwiftUI Wheel Picker causing Overlay transition animation stutter?

I have buttons toggle isOverlayShowing which calls out the overlay using edge transition from bottom. You can see from the video below, both using the same OverlayModal and same animation duration, but the one for the wheel picker seems to stutter…
0
votes
1 answer

How to create asymmetric animation in swiftUI

I'm curious, is there a way to create asymmetric animations in swiftUI? To be clear, I know that you can use .asymmetric to specify different insertion and deletion behaviours for Views that are added and removed. That's not what I'm looking for. I…
Curious Jorge
  • 354
  • 1
  • 9
0
votes
0 answers

BottomSheet Animation Delay

I am working on a bottom sheet for my code using the built in functionality of .sheet. Is there a way for you to disable the initial animation where it comes from the bottom and just have appear on screen when you open up the view. The video I have…
0
votes
1 answer

Catch animated variable in SwiftUI

I have a simple SwiftUI macOS view that animates some text by altering the font size when tapped. It goes from a fixed value to another. The animation works perfectly, but I'd like to add an extra piece of interaction. In the view there's a hidden…
0
votes
1 answer

MatchedGeometryEffect + Image Url

Can someone please explain why MatchedGeometryEffect works with images from the assets folder but not from URLs? And how do we get around this so we can use MatchedGeometryEffect with actual images? Video with Image Asset (works):…
0
votes
1 answer

How to override default behaviour of NavigationView and NavigationStack in SwiftUI?

I'm curious, is there a way to override the default slide-in behaviour when navigating in SwiftUI? Here's some code where I'm unsuccessfully attempting to use .transition to affect the animation: struct TransitionOnNavigation: View { var body:…
0
votes
0 answers

SwiftUI Animate Shape from Point A to Point B

I want to have a large Circle (A) start out in the middle (or near middle) of the screen. I then want to animate Circle A so that it will move along a path starting from the middle, along a curved path, up to the upper-left of the screen. As it is…
dohpaz42
  • 520
  • 4
  • 18
0
votes
0 answers

SwiftUI rotation animation start and stop

I'm dealing with rotation animation. I want: when the button is clicked, the Shuriken will rotate continuously When you click the button again, the Shuriken will rotate slowly and then stop But I'm having a problem, when Shuriken rotates slowly,…
finn
  • 1
  • 1
0
votes
0 answers

Tab Bar Curve SwiftUI

I need to round the edges of the tabbar and make a rectangular line on each button when pressed. It is necessary to make a corner radius for the tabbar and a rectangular curve for the code button. The code is working, but I need help. thank…
0
votes
1 answer

Basic SwiftUI Animation using `withAnimation` block over a Bool value

I am having a basic SwiftUI view setup. When I tap the Show button, I expect the overlay to appear with a 2-second animation. Similarly, when I tap the close button on the overlay view, I anticipate the overlay to dismiss with a 2-second…
Gerry Gao
  • 1
  • 1
0
votes
1 answer

How to animate a subview based on Picker-selection in SwiftUI?

Trying to understand animations/transitions in SwiftUI, but I'm totally lost. Everything regarding animations seems to be triggered by a bool state-variable. How would I animate the "Text()" in my if-else-blocks in the code below? Say I want to…
irrbloss
  • 207
  • 2
  • 9
0
votes
0 answers

Canvas not being updated when @State variable animates

Why isn't Canvas getting updates on animated @State variables? For example when I animate the rotationAngle as seen here: @State private var rotationAngle: Double = 90.0 HStack { Canvas() { print(rotationAngle) //prints 90.0 at the…
h4master
  • 31
  • 3
0
votes
2 answers

Swift UI - Animating long line of text to scroll left and right

I would like to animate long single line of text to display the entire text by scrolling left and right on repeat. I tried to do this myself using the following code, but it just scrolls to the end of the text when the view is loaded. It doesn't…