269 questions
0
votes
2
answers
86
views
Prevent matchedGeometryEffect from animating during transition
I am trying to present a modal that contains an element using matchedGeometryEffect. I’ve run into a problem — if I animate the transition, the matchedGeometryEffect animates as well. I’d like it not ...
0
votes
0
answers
17
views
Concurrent animations in SwiftUI [duplicate]
I have a view that can be in two different positions depending on the state of the rest of the app.
The same view can contain either two or three buttons depending on some state that is determined ...
0
votes
1
answer
116
views
Animating items in a SwiftUI list only at first appearance
I have a simple SwiftData app. Whenever ImageLibraryView appeared, there were microhangs because images inside each ThumbnailView were being loaded synchronously.
So I solved that by loading the ...
-3
votes
1
answer
98
views
How to animate substring in a Text?
Currently, I am using multiple Texts in a horizontal stackview, to achieve animation of substring.
As you can see in the above animation, the text
- conversation
- meeting
- lecture
are animated.
...
0
votes
0
answers
161
views
How does one animate an annotation on a SwiftUI Mapkit Map?
I'm attempting to animate an array of annotations on a SwiftUI MapKit Map and not getting the behavior I'm expecting. I see lots of examples on how to animate the map camera, etc, and even a few on ...
-1
votes
1
answer
154
views
SwiftUI animation - Understanding how state changes are handled / animated
I am struggeling to understand how exactly SwiftUI animates view changes in a concrete example I am working on.
TL;DR The description of the problem and the code is quite long. The basic question is: ...
1
vote
0
answers
126
views
How can I make the legend of a pie chart remain static during the chart’s animation when using 'sectormark'
I was trying to make the animation of a pie chart, I was trying to make the appear layout animation. (As the user navigates to the page, the pie chart will animate, starting from the 12 o'clock ...
0
votes
0
answers
32
views
I'm trying to add animation to the buttons that were not tapped [duplicate]
Is a game selection with 3 different options per round. I added an animation to the button selected. But I'm trying to add an animation for the buttons that are not selected. I'm new to Swift and ...
1
vote
1
answer
41
views
Mutating reference type doesn't work with .animation(_:value:)
How can I animate changes to a view when the value being mutated is a reference type?
In the example below, changing the reminder time updates the order but without animation.
I thought arrays were ...
0
votes
2
answers
1k
views
SwiftUI Animation: How do I customize the transition animation (fade out THEN fade in)
This code would produce an animation that crossfades the values whenever I change self.myTextString:
// In some View's body method
Text(self.myTextString)
.transition(.opacity)
.animation(.easeInOut(...
0
votes
1
answer
719
views
Animation problem when using Namespace and MatchedGeometryEffect
I've caught a very strange problem (THAT ONLY OCCURS ON REAL DEVICES) that has to do with using @NameSpace and MatchedGeometryEffect using NavigationStack. The problem is that if I go from the first ...
0
votes
1
answer
154
views
How to animate this in SwiftUI?
I am new to iOS development and I have been working on a project using SwiftUI. I have a sheet where I can buy or sell some stocks. On successful transaction, I am supposed to show a green screen with ...
1
vote
1
answer
399
views
Adding items to ForEach and animate the items below nicely so it doesn't jump
I'm trying to get this to animate nicely when I add elements to my array.
Currently the button jumps down after the foreach elements are added.
Here's my code:
import SwiftUI
class ...
2
votes
2
answers
114
views
Selectively apply implicit/.animation-modifier-based animations
Given the following example that uses explicit animations (withAnimation) to change the size of a rect (animated) and its color (not animated):
struct ContentView: View {
@State var size: ...
1
vote
1
answer
445
views
SwiftUI symbol effects animate on scrolling list only when in Stack view
When: Embedding a Image with a symbol effect in a stack view in SwiftUI, and putting this in a List
Actual: The symbols animate when scrolling that item in and out of the view
Expected: The symbol ...
0
votes
1
answer
142
views
SwiftUI trajectory transition animation
I am struggling with the animation of views when inserting them into a stack. In general, I am trying to create an effect where cards fly out from the stack and move to their final destination. I have ...
0
votes
2
answers
1k
views
SwiftUI .matchGeometryEffect not working smoothly
I've been trying for sometime now to figure out why the .matchGeometryEffect is not transitioning smoothly in my use case. The state change speed is not consistent, growing quicker and going back ...
2
votes
2
answers
2k
views
How to simultaneously perform multiple animations to one element in SwiftUI?
I have a WaveView which is just a sine wave and a rectangle. To make it act like a real wave, I need it to translate unstoppably. So I wrote a Wave view and added an animation on offset with a timer ...
1
vote
1
answer
635
views
SwiftUI Animation Issue ForEach
Today I faced an issue with animations depending on which kind of ForEach I use. To be honest I don’t understand what exactly the issue is.
I created this little example for you.
The AudioIndicators ...
1
vote
1
answer
197
views
How to use frame animation similar to UIKIT in swiftUI
I'm just using swiftUI.
I want some one view to have a repeating animation: 1.move up, 2.pause, 3.move up, 4.pause, 5.move down, 6.pause, 7.move down, 8.pause.
Similar to the undulations of pixel wind ...
1
vote
2
answers
5k
views
My Animation in SwiftUI is not working properly
I have a problem with animation in SwiftUI, if I'm using .animation, my animation is not working.
ZStack(alignment: .bottom) {
VStack {
Button("Button") {
showView....
5
votes
1
answer
831
views
SwiftUI Sheet Animation Issue with Non-Default Background Colors
I'm working on a SwiftUI project where I use a .sheet modifier to present a bottom drawer with two detent sizes: .medium and .large. The drawer contains a button that toggles its size between these ...
0
votes
1
answer
921
views
How can I update view when ScrollView scrolling in SwiftUI
I'm new to SwiftUI and I'm trying to update the view while ScrollView is scrolling. As I scroll the screen, I want to increase the size of the image in the middle by 1.2, increase the visibility of ...
0
votes
1
answer
282
views
How to alter a button's label animations from multiple view in my project?
I have a SwiftUI button in one of my views. For the label I use two different SF Symbols with different colors and animations based on the value of a var "gpsIsActive"
Here is a video:
The ...
1
vote
1
answer
181
views
How can i get animation when click a button that in List?
My code is like this:
List {
Button(action: {}, label: {
Text("Button")
})
Button(action: {}, label: {
Text("...