Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
71 views

I’m building a reusable custom bottom sheet component in SwiftUI because my app supports iOS 15, so I can’t use .sheet with detents yet. Functionally everything works the sheet opens and closes but I’...
K. Janjuha's user avatar
0 votes
2 answers
86 views

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 ...
Andriy Gordiychuk's user avatar
0 votes
0 answers
44 views

In macOS Sonoma, my SwiftUI code performs smooth, expected animations when List contents change — both when using @FetchRequest with a changing predicate and when filtering manually via Picker ...
user10711707's user avatar
0 votes
0 answers
17 views

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 ...
Pablo's user avatar
  • 317
1 vote
1 answer
101 views

First here's a block of code that reproduce the issue: import SwiftUI struct CustomAnimation: ViewModifier { @State private var isAnimated: Bool = false func body(content: Content) -> ...
Damien's user avatar
  • 3,397
0 votes
1 answer
119 views

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 ...
RRR's user avatar
  • 315
0 votes
0 answers
44 views

I have one view named CongratulationOverlay, and in bottom there is one horizontal list. Now I want that overlay view to slide in to the horizontal list as I am appending that into list. and ...
Jatin's user avatar
  • 1
-3 votes
1 answer
98 views

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. ...
Cheok Yan Cheng's user avatar
2 votes
2 answers
106 views

I am working on geometryMatchEffect and struggled on one point. In my case, when tap on a item, the item should be fly to page of the top and other items should remain backside. And then when tap on ...
Okan T.'s user avatar
  • 86
0 votes
0 answers
162 views

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 ...
Scott's user avatar
  • 1,114
0 votes
1 answer
149 views

How can "complex" animations be composed in SwiftUI? Where complex means that the complete animation is composed out of multiple sub-animation. Example I am working on migrating an existing ...
Andrei Herford's user avatar
-1 votes
1 answer
156 views

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: ...
Andrei Herford's user avatar
0 votes
2 answers
119 views

The simple code below moves the text by updating the @State var offset within a withAnimation block. struct ContentView: View { @State var offset: CGFloat = 0 var body: some View { ...
Andrei Herford's user avatar
1 vote
0 answers
126 views

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 ...
user27961078's user avatar
1 vote
1 answer
880 views

I am having an issue after updating to Xcode 15 where my view unexpectedly moves when trying to animate a rotating Circle() in SwiftUI. Previously, this code worked perfectly, but now the entire view ...
Jawad Saud's user avatar
0 votes
0 answers
32 views

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 ...
Joshua Rosado Olivencia's user avatar
1 vote
1 answer
592 views

Hey I'm using the new SwiftUI Charts to display a graph to display a line graph for a user's weight. The issue that I am running into specifically is trying to animate the scroll position of the ...
victorydub's user avatar
1 vote
1 answer
48 views

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 ...
WorldNeedsRefactoring's user avatar
0 votes
1 answer
117 views

I am wanting to animate switching between tabs but the animation are very hard. I tried using matched geometry but the animation was wacky. Could be lack of understanding on matched geometry. The ...
abcdefg's user avatar
  • 119
0 votes
2 answers
1k views

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(...
horseshoe7's user avatar
  • 2,847
0 votes
0 answers
386 views

I'm trying to have a matched geometry effect where a Text() is being animated across two different screens/views. I want the animation to continuously interpolate the texts size between the source ...
Nerdy Bunz's user avatar
  • 7,743
0 votes
1 answer
723 views

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 ...
Simimi_Dot's user avatar
0 votes
1 answer
72 views

I've got a parent view that presents one of a couple of views, depending on the value of an observed variable. In the simple example below, RainbowView is presented when the @Published variable "...
Andromeda's user avatar
  • 683
0 votes
1 answer
154 views

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 ...
Kishan Seksaria's user avatar
0 votes
1 answer
64 views

I would like to have a transition when the I'm iterating through the index of an array. I would like to display several notifications, and after 7.5 seconds I want to display the new one with a ...
user avatar
1 vote
1 answer
405 views

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 ...
P. Sami's user avatar
  • 2,217
1 vote
0 answers
84 views

I have a badge component with a built-in transition: public struct BadgeView: View { ... public var body: some View { Text(stringValue) .background(.red) ....
BlackWolf's user avatar
  • 5,699
2 votes
2 answers
116 views

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: ...
Ralf Ebert's user avatar
  • 4,162
3 votes
0 answers
79 views

The target view has .opacity() and .offset() modifiers in a scoped animation (iOS 17): Text("Hello, world!") .animation(.default) { $0 .opacity(animate ? 1 : 0.2) ...
clns's user avatar
  • 2,354
1 vote
1 answer
452 views

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 ...
Adam Carter's user avatar
  • 4,864
0 votes
1 answer
350 views

Using a delayed animation on an HStack causes the animation to become out of sync with the view layout. This looks like very simple SwiftUI code. Without the animation .delay(), everything works fine. ...
clns's user avatar
  • 2,354
0 votes
1 answer
142 views

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 ...
Igor's user avatar
  • 33
2 votes
0 answers
145 views

Expanding a SwiftUI View causes the LazyVGrid to remove all the items that will not be seen when the animation is completed. Additionally, when scrolling down the items animate from their original ...
Joel's user avatar
  • 21
0 votes
2 answers
1k views

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 ...
Astro's user avatar
  • 279
2 votes
1 answer
127 views

I'm trying to create a custom 'tab' selection control with a horizontal row of options and the user can select one of N number of options. The 'selected' option will have a 'border' around it. Here's ...
Z S's user avatar
  • 7,577
2 votes
2 answers
2k views

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 ...
richardjorne's user avatar
1 vote
2 answers
554 views

I would like to find out when the sheet presentation animation concludes in SwiftUI. While in UIKit, this is easily achieved with the present(_:animated:completion:) function. The completion block in ...
Amirca's user avatar
  • 323
1 vote
1 answer
638 views

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 ...
Spriter's user avatar
  • 653
2 votes
2 answers
548 views

TLDR: how to render a whole subview before fading it in? Consider this code snippet: a simple white view and a button that toggles an overlaying FrontView. The FrontView is a superposition of 2 black ...
Martin's user avatar
  • 12.2k
1 vote
1 answer
198 views

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 ...
user23194465's user avatar
2 votes
0 answers
541 views

In SwiftUI, I'm working with two screens, Screen A and Screen B. I'm attempting to create a transition effect using SwiftUI's matched geometry feature. The transition involves two rounded rectangles: ...
Nerdy Bunz's user avatar
  • 7,743
1 vote
2 answers
5k views

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....
Suweey's user avatar
  • 43
0 votes
0 answers
111 views

I want a view to come in from the right when pressing a component. The issue is that the Vstack that contains the LazyVGrid slides into the screen after the LazyVGrid components appear (w/o a ...
JorBrown's user avatar
5 votes
1 answer
841 views

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 ...
Dan Flict's user avatar
  • 199
2 votes
1 answer
484 views

I have a theoretical question about SwiftUI, the timing of the onDisappear() method, and view transitions. Lets say you have a navigation setup like this: enum ScreenToShow { case main, editting, ...
Nerdy Bunz's user avatar
  • 7,743
0 votes
1 answer
924 views

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 ...
onur.altintas's user avatar
0 votes
1 answer
220 views

I'm facing a memory leak problem in iOS 17, in earlier versions it works fine: import SwiftUI struct SkeletonModifier: ViewModifier { @State private var phase: CGFloat = 0 let animation: ...
Konstantin.Efimenko's user avatar
0 votes
1 answer
286 views

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 ...
HirsuteJim's user avatar
1 vote
0 answers
58 views

Lets say we're using SwiftUI and we are using a timer to fire X times per second. Every time the timer callback fires, we update a @State variable that triggers a view update with the new value. Lets ...
Nerdy Bunz's user avatar
  • 7,743
1 vote
1 answer
183 views

My code is like this: List { Button(action: {}, label: { Text("Button") }) Button(action: {}, label: { Text("...
stul's user avatar
  • 82

1
2 3 4 5 6