Questions tagged [swift]
Swift is a general-purpose programming language developed by Apple Inc first released in 2014 for its platforms and Linux. Swift is open-source. Use the tag only for questions about language features or requiring code in Swift. Use the tags [ios], [ipados], [macos], [watch-os], [tvos], [swiftui], [cocoa-touch], and [cocoa] for (language-agnostic) questions about the platforms or frameworks.
swift
192
questions
0
votes
0
answers
7
views
Restore window size successfully but view content showing cut in catalyst app
I am trying to restore window size when user reopen app.i have successfully restore window size but actually problem is when app start view content is cut to top size.so can any one help for this.
...
0
votes
0
answers
12
views
How to prevent a selectable List from being updated when a confirmation dialog appears?
Let's us a selectable List as follows:
import SwiftUI
struct ContentView: View {
@State private var elements: Set<UUID> = [.init(), .init(), .init()]
@State private var selection: Set&...
0
votes
0
answers
13
views
Using AVFoundation scaleTimeRange API will cause different export file duration
I m validating one thing: The composition's duration is the same as it has been exported.
This is ok when no scaleTimeRange.. I don't know why the exported file duration is not the same as ...
0
votes
0
answers
13
views
iOS Widget Disappearing After App Updates
I've got these widgets available for users to choose from, which all work for some time. However, some users (including me, on my iPad only), are reporting that their widget disappears after app ...
0
votes
1
answer
20
views
How to match the size of an hstack to its parent view in certain context?
I am trying to recreate Whatsapp's message reply functionality in SwiftUI.
Basically I have a view that represents a message and the max width of the message is 300. So when a message has an older ...
-4
votes
0
answers
16
views
iPhone Stimulator not loading in XCode [closed]
my iOS Stimulator isn't loading in XCode and I get the error "Cannot Preview in this File" error. This is a brand new project and I haven't done any changes to the default project.
I tried ...
-3
votes
0
answers
15
views
How to have a performant pitch detection for iOS [closed]
I want to have a performant (so maybe c or c++) library to have a pitch detection on my iOS app.
I search a lot but no found at all.
Thanks all !
0
votes
1
answer
20
views
How to restrict a contextual menu to a single collectionView
I have a view with three collection views on it. I want one of the collection views to have a contextual menu. How do I control that only one of them has the menu? In the code below, I have commented ...
0
votes
0
answers
22
views
How to prevent isAllDay events spanning multiple day when querying devices calendar SwiftUI
I assume the issue is daylight savings. I just can't figure out a fix
My setup. I have a schedule view. on which I want to display the users Calendar events on. Each day in the schedule queries for ...
1
vote
0
answers
27
views
SwiftUI View Not Updating wit from ViewModel
I have a RunningCommandView where I run a command on macOS and observe the outputs to display them on the screen. However, the view is not updating with the outputs. I added a button to manually ...
0
votes
0
answers
21
views
Take photo without camera view popping up
As an initial test for something more complex, I want to make a simple app that takes a picture when pressing a button and displays it directly within the app, without opening the camera view, and ...
0
votes
0
answers
24
views
When i choose 3rd date the date range won't be nil in swift
i use AirBnb's horizon calendar and the issue is when i click on a date out of range i cant make the selectedDateRange nil. In this date picking logic what am i missing?
.days { day in
DayView(...
0
votes
0
answers
33
views
How to manage global state in SwiftUI and persist it
Continuing learning SwiftUI (which is so much fun) I'm doubting the way I'm managing (and storing) global state in my app and storing it. There are two categories of data that I need to manage. The ...
-1
votes
0
answers
16
views
StoreKit 2 Xcode Manage Transactions - subscription purchased but "unfinished"?
I am using SubscriptionStoreView in conjunction with the modifiers .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionSheet to allow my users to choose from either a monthly ...
0
votes
1
answer
22
views
How to force releasing memory
I’m trying to iterate over a large file tree reading URL’s and creating hash values, but there’s a memory leak I can’t fix. The consumed memory is growing until the app stopp working. For testing ...