Questions tagged [swiftui-animation]
228 questions
1
vote
1 answer
Bouncing ball-like animation to draw attention towards a button
I already checked various tutorials and information but cannot put together the last mile.
My code is
struct WelcomeView: View {
@State private var chevronAnimationRunning = true
var body: some View {
Image(systemName:…

Adrian Föder
- 770
- 1
- 7
- 22
1
vote
1 answer
SwiftUI spring animation issue
When I use spring animation, you can see that the Giriş başarısız text remains inactive. This text comes from the backend. When I give a static value, the animation does not break, but when I give a dynamic value, why does it break the…

Ufuk Köşker
- 1,288
- 8
- 29
1
vote
1 answer
Make second view gray SwiftUI
I have 2 views. 1 main view and 1 alert view.
The alert view will appear in the front of the main view. I want to lower the white color from the entire main view when this happens. Like a gray or light gray when the alert view is on front.
My main…

dhaval123
- 107
- 11
1
vote
1 answer
Translation with simultaneous animated rotation of view does not stay at anchor point
I have a gray view that can be moves around the screen.
The gray view has a child view (think of it as a clock hand) that rotates with an animation.
The angle at which the child view rotates correlates directly to the translation value which the…

iMaddin
- 982
- 1
- 14
- 23
1
vote
0 answers
Animation jumps during NavigationLink transition
I was trying to do a simple navigation between two views programmatically using NavigationLink, but I'd like the navigation transition to fade as opposed to sliding in from the right. I do this with these modifiers around the…

drainmond
- 11
- 3
1
vote
1 answer
List animations ignoring Animation parameter
I've been trying to get changes to my list elements to animate correctly. However, items in a list don't seem to animate as specified.
In this simple example, an element is removed. There is an animation, within 1 second the element is removed.…

Alex Hartog
- 11
- 1
1
vote
1 answer
Animate a button's text and position at the same time in SwiftUI
I have a very simple view that only shows a Text, a Shape, and a Button stacked vertically in a ScrollView. The Shape is a Capsule and is conditionally shown only when showCapsule is true.
struct ContentView: View {
@State var showCapsule =…

Mischa
- 15,816
- 8
- 59
- 117
1
vote
1 answer
SwiftUI Transition + LinearGradient + Opacity weird behavior
I'm trying to animate opacity on appear/disappear of Text view with a simple linear gradient.
Here's the "minimum" code I have right now:
import SwiftUI
struct ContentView: View {
@State var shown: Bool = true
var body: some View {
…

Volodymyr Bobyr
- 329
- 2
- 12
1
vote
0 answers
How to detect and perform necessary actions when user clears the live activity from the Lock Screen
Looking for a solution to re create the same live activity, if the user clears it from the Lock Screen.
Is there any way, we get some callbacks in code as soon as user clears the live notification from the lock screen.
Or is there anyway we can…

Shubham yerne
- 21
- 3
1
vote
1 answer
CarouselView not snapping onto the image
I made a carousel based on a YouTube video I found (https://www.youtube.com/watch?v=4Gw5lDXJ04g&t=416s). I implemented everything, it shows my images but when I scroll to the right it's not snapping on to the image
I expected it to snap onto the…

robbe505
- 13
- 3
1
vote
2 answers
How can I make a bottom sheet appear behind a tabView?
Does anyone know how I can create a bottom sheet similar to the one in the Diary Queen app. I have tried a few times but every thing I've tried has made the bottom sheet appear above the bottom tabview. I need it to appear from behind the tabview…

k.arias
- 11
- 2
1
vote
0 answers
How to properly animate a Slider in SwiftUI?
I want to animate a Slider whenever its value changes with a custom animation (with a custom duration). But somehow it doesn't work. No matter what animation I specify, it always uses the same (very short) animation that is almost not…

Mischa
- 15,816
- 8
- 59
- 117
1
vote
0 answers
How do you animate a lock screen widget on iOS 16?
In iOS 16, Lock screen widgets allow you to add an Image to the WidgetView, like in accessoryCircular.
How do you animate this Image? Loading the Image from an animated UIImage with frames just displays the first frame.
Am I missing a startAnimating…

Erika Electra
- 1,854
- 3
- 20
- 31
1
vote
0 answers
ZStack explicit animation not working when conditionally hiding/showing a view
I want to create some sort of banner view that either moves in or out with animations when some state changes in SwiftUI. It feels like a basic task to do but the transition when showing the banner is not being animated. Hiding works fine.
So for…

ph1psG
- 568
- 5
- 24
1
vote
0 answers
SwiftUI appear transition doesn't work inside NavigationStack
When I tap on an item in a list, I'd like to transition a view in from the leading edge.
Currently:
When I use ListView by itself, the appear transition works fine.
When I wrap ListView in a NavigationStack, the Image's appear transition does not…

Joshua Breeden
- 1,844
- 1
- 16
- 29