Skip to main content
The 2024 Developer Survey results are live! See the results

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.

0 votes
0 answers
3 views

Passing argument of non-sendable type 'PhotosPickerItem' outside of main actor-isolated context may introduce data races

My code looks like this and there's a concurrency warning when accessing the loadTransferable for the selectedPhoto from PhotosPicker struct SampleCode: View { @State var showOptionSheet = false ...
smekers's user avatar
  • 13
0 votes
0 answers
8 views

Using MapKit to select places and extract info

I'm a bit lost on implementing a way to select a local business/place after a search and extract the phone number and name of the place. I want to do this using a sheet pop up but I'm not able to ...
Defaced.Face's user avatar
0 votes
1 answer
10 views

Is there an image cropping interface in PhotosUI/SwiftUI

I am unable to find a way to show the cropping interface like in WhatsApp when using PhotosUI in SwiftUI. Eg: I’m assuming this is the standard UI provided by Apple and not custom made by WhatsApp. ...
rayaantaneja's user avatar
  • 1,686
-1 votes
1 answer
18 views

Swift - Time Consuming Processing of an Array

I am trying to process over an array of simple elements, where on every element of the array a time-consuming process of updating the UI with a Timer will be started. The order of the elements in the ...
Nikita Alexander's user avatar
1 vote
0 answers
23 views

Navigating to swiftui view from push notification

I have a multiple root navigationView in swiftui view, I am setting the root based on a state variable, the issue is that when I am navigating to a screen from a push notification click and then click ...
Muhammad Noamany's user avatar
0 votes
0 answers
15 views

fail to implement SwiftUI object tracker

I want to use SwiftUI to implement a camera which can track object, and then I find source code using UIView, I want to migrate it to SwiftUI my key code is here and I delete non-relative part(camera ...
zzhzzh's user avatar
  • 13
0 votes
0 answers
17 views

Fatal error during migration to add an enum field

I'm migrating my two SwiftData models to a V2 VersionedSchema. In this migration, I do the following changes: Change two field types Change a Relationship deleteRule Add a field with a Codable enum ...
Tim's user avatar
  • 163
0 votes
0 answers
7 views

Issue with Offer Code Redemption: SKPaymentQueue Observer Not Notified in StoreKit

I'm developing an iOS app that supports in-app purchases and I'm using StoreKit2 for handling transactions. While purchase, promotion, and restore purchase functionalities are working fine, I'm facing ...
Pushpendra Singh's user avatar
0 votes
1 answer
21 views

Why does running an iOS app through macOS cause "Failed to look up symbolic reference" crash?

I'm trying to run an iOS app natively using macOS, now that Apple-Silicon-based Macs support running iOS apps natively. But for some reason when I ran the app, right after it finishes launching it ...
cleanrun's user avatar
  • 651
0 votes
0 answers
16 views

Is it possible to find out the list of devices for an account like in the "Find My" app?

Is it possible to somehow find out the list of devices for a given account? Is there an API? How in the application "Find My"
Steven Kirke's user avatar
0 votes
0 answers
28 views

How to remove button highlighted style?

I have a button with background image. I have a grey color when I click on my button. I want to remove this grey fill image color. How to do it? example: code: barButton = SLButtonWithImage(type: ....
user's user avatar
  • 29
0 votes
1 answer
32 views

Cannot convert value of type 'Int?' to expected argument type 'Binding<Int>' error in Swift

Getting a cannot convert value of type 'Int?' to expected argument type 'Binding'. Trying to store a value in Book for SwiftData value for rating. Rating is not a value in JSON database while all ...
user1233894's user avatar
  • 1,604
0 votes
0 answers
12 views

Ignore top safe area for UICollectionViewCompositionalLayout.list

I am using compositional layout in a SwiftUI app. I am using the list version of UICollectionViewCompositionalLayout and want the list to ignore the top safe area. I can't find any sources on how to ...
SwiftUIEnthusiast's user avatar
0 votes
1 answer
17 views

Data not Reflecting Immediately After Background Save in SwiftUI App with SwiftData

I’m working on a SwiftUI app where I save a playlist to a database in the background. The issue I’m facing is that after saving a new playlist, the main view does not reflect this change immediately. ...
Damiano Miazzi's user avatar
0 votes
0 answers
15 views

Best format and way to share audio or video using ActivityView Controller in Swift

I am new to audio and video assets in Swift and am trying to enable users to share audio or video using ActivityViewController. To share text and images I can do: var bestContent0 = "Check out ...
user6631314's user avatar
  • 1,874

15 30 50 per page
1
2 3 4 5
22315