Questions tagged [swiftui]
SwiftUI is a way to build user interfaces across all Apple platforms. Build user interfaces for any Apple device using one set of tools and APIs. With a declarative Swift syntax that’s easy to read and natural to write, SwiftUI works seamlessly with Xcode design tools to keep your code and design perfectly in sync. Automatic support for Dynamic Type, Dark Mode, localization, and accessibility. Use this tag for questions about SwiftUI on any platform.
swiftui
39,623
questions
-2
votes
0
answers
9
views
How to update the uiview with the progress of class method
I have a UIView with a list of items. When one item is deleted from the list an overall variable will be recalculated in the model class, which will take some time as it will go over all data on all ...
0
votes
1
answer
12
views
WidgetKit Not running in iOS 14/15 (FBSOpenApplicationServiceErrorDomain)
I was adding WidgetExtension target for my old project.
The widget target is running fine in iOS 17, In my case, widget need to support iOS 14 and above, so I updated my widget code to old style, To ...
0
votes
0
answers
25
views
Navigation link cannot be activated
I am working on combining two feeds in the same view. They are held inside a ZStack enclosed by a NavigationStack. The issue arises when clicking on the tab bar item to navigate to the message view, ...
0
votes
0
answers
11
views
Any way to set the view ID to after animation transition?
In SwiftUI I have this sequence I'd like a specific way where I swipe up in frame 1 into frame 2, then swipe left into frame 3. This works fine, as intended.
I did this by changing the views so ...
-5
votes
0
answers
31
views
'onChange(of:perform:) was deprecated in iOS 17.0: Use onChange with a two or zero parameter action closure instead? [closed]
struct SudokuCellView: View {
@Binding var value: Int?
var onCommit: (Int?) -> Void
var body: some View {
TextField("", value: $value, formatter: NumberFormatter())
...
1
vote
1
answer
19
views
Stop NaviationLink overriding DisclosureGroup ontap gesture
I have the following SwiftUI view:
import SwiftUI
struct ContentView: View {
var items = [1, 2]
var body: some View {
NavigationStack {
List {
ForEach(self....
1
vote
2
answers
26
views
Why doesn't LazyVStack release memory when scrolling
I have a `PhotosPicker` that selects an image. Then, upon pressing the "Save" button, I save it in `FileManager` and store its path in `CoreData`. When I need to retrieve them, I use a `...
0
votes
1
answer
28
views
How to detect a change in the value of “editMode” from a toolbar?
Let's use a selectable List as follows:
import SwiftUI
struct ContentView: View {
@State private var elements: Set<UUID> = [.init(), .init(), .init()]
@State private var selection: Set&...
-4
votes
1
answer
42
views
Why isn't CADisplayLink Sendable?
I'm looking at the this SoF answer and when I tried it out, I got the warning:
Non-sendable type 'CADisplayLink?' returned by implicitly asynchronous call to nonisolated function cannot cross actor ...
0
votes
1
answer
30
views
Loading View animation don't work as needed in SwiftUI
I created this animation depending on a Boolean value to show as a loading animation. I wanted it to blink only in the middle of the view but it enters the view from top left hand corner, comes into ...
0
votes
0
answers
19
views
SwiftUI paging with custom scrolling control
I'm new to SwiftUI, and I'm trying to design a paging view associated with a custom tab bar control. The tab bar should be scrollable and synced with the main view. Tap to select on the tab bar should ...
0
votes
1
answer
31
views
Why won't a SwiftUI Slider trigger a change to a small range?
I am trying to make a slider update a value if it changes. In this case, I'm looking for a lower and upper bound in a range from 0 to 4. If the min value is greater than the max value, I want the max ...
0
votes
1
answer
27
views
Why don't I need to toggle the isPresented variable myself for an alert?
Am working with an .alert in SwiftUI with the code below. I found that I do not need to toggle the isPresented variable myself within the buttons' closures.
Just need to make sure this is standard, ...
1
vote
0
answers
43
views
Why does my SwiftUI app crash when opened from an intent?
I'm encountering a crash in my SwiftUI app when it is opened via an AppIntent. The app runs perfectly when launched by tapping the app icon, but it crashes when opened from an intent.
Here is a ...
0
votes
1
answer
13
views
Share data between screen in SwiftUI with UIKit navigation
I have an iOS project written in SwiftUI but the navigation is handled with UIKit.
Therefore each view has its own UIHostingController which takes care of initializing the view written in SwiftUI ...