Questions tagged [swiftui-animation]

228 questions
0
votes
0 answers

How can I make parts of a SwiftUI transition crossfade, but other to not crossfade

I have a view, with several subview (in my sample the label one and two). When I tap on one of them, I would like to transition to a view, where everything else, but that original view that I tapped on is still visible. (In my real world app it's…
Georg
  • 3,664
  • 3
  • 34
  • 75
0
votes
0 answers

NavigationStack (Custom Package) Animation Mismatch

I've created a wrapper around navigation stack API with replace root & push and remove until features. There is one bug that I couldn't overcome for a while. There is one issue that mismatches pop and pushes animations after certain navigation…
0
votes
0 answers

changing position of image or view during animation is not working as expected in SwiftUI

I am trying to build walkthrough pop up tip and i want to change of pop up position once the user move to next walkthrough pop up tip. Unfortunately, changing or adding new image or view in current animation view is not working as expected. Newly…
venky
  • 1,155
  • 1
  • 11
  • 26
0
votes
0 answers

How can i animate data fetched from API in my ScrollView/LazyVGrid?

This is my main view where i'm using AsyncAwait to fetch the data. I wanna have the effect of nice animation when i receive the data. Tried a lot of things, but none worked. Some animations were successful but only after opening the specific view…
0
votes
1 answer

Bounce animation is working only after second tap [SwiftUI]

I am triggering animation after unhiding the view unfortunately animation is not working unless I tap twice struct ContentView: View { @State var animate = false @State var isViewHidden: Bool = true var body: some View { …
venky
  • 1,155
  • 1
  • 11
  • 26
0
votes
1 answer

SwiftUI: Stop Continuous Animations When Views Leave Screen

Context NB: The question does NOT pertain to iOS I have a Mac app that shows an NSPopover. The content of that popover is an NSHostingView that displays a simple SwiftUI view: struct PopoverView: View { @State private var buttonWidthScale:…
Bryan
  • 4,628
  • 3
  • 36
  • 62
0
votes
0 answers

SwiftUI pop-out animation causes characters to shake on physical device

I'm attempting to do a simple pop-out animation with some text and an image in SwiftUI. In the preview on the simulator it looks fine, but when using a physical device to preview or when building and running on a physical device the characters in…
CodingLamb
  • 61
  • 1
  • 5
0
votes
0 answers

Is there anyway to constrict an animation to it's container in SwiftUI?

I have the following code: struct ProductView: View { let images = ["BackAndFront", "BackAndSide", "FrontAngle"] @State private var imageIndex = 0 var body: some View { ZStack { VStack { HStack { …
Alfie CG
  • 3
  • 1
0
votes
0 answers

swiftUI geometryEffect animation

I'm practicing swiftui geometryEffect by applying it to a transition from view to another. The first view has three circles with different colors, the user selects a color by tapping the desired color, and clicks "next" to go to second view which…
0
votes
1 answer

How can I get SF Symbols components?

I would like to get the components of an SF Symbol so that I can then animate it, with animations on the individual components. Is it possible? For example, in the photo below I would like to separate the raindrops from the cloud. Thanks!
0
votes
0 answers

SwiftUI: withAnimation not working with App @State

I have a @State var opacity at the App level (i.e. not in a View). I would like to animate its changes. The changes do get applied (causing re-render), but it doesn't animate. I could only get animation to work when I moved that state var into the…
bzyr
  • 289
  • 1
  • 11
0
votes
1 answer

SwiftUI animation transition of conditional views

So, i have this little app with a button where i can change the how the main view display its items, with a grid or list. But i would like to add a little animation when it makes its transition from one to another. I messed i little bit trying to…
Boga
  • 371
  • 3
  • 14
0
votes
2 answers

In SwiftUI, how do I initialize an animated value based on the screen height?

I am new to SwiftUI but a very experienced developer (which may even be a hindrance here). I have a full-screen, highly graphical app/game. One of the requirements is for a specific image to animate by floating up and down. Doing this is…
Mark Brittingham
  • 28,545
  • 12
  • 80
  • 110
0
votes
1 answer

How to animate a view transition on a conditional view?

The setup is quite simple: State/Observable/Computet property, let's call it S1 Views (V1, V2) that depend on S1 The following conditions must hold: V1 should have a transition for in/out and be animated Other views (e.g. V2) must not be animated…
Leo
  • 1,508
  • 13
  • 27
0
votes
0 answers

SwiftUI when animating the button with scaleEffect, lines remain along the border of the initial size

I am trying to create a button with an bounce animation affect on tap using SwiftUI. The code below does the correct animation and everything works fine in preview. But when running the same code in the simulator after the animation is done, I…
Danny
  • 3,975
  • 4
  • 22
  • 35