335,823 questions
0
votes
0
answers
18
views
How to navigate in SwiftUI while also executing logic and creating a new Object?
I have a EditTapasView which is there to edit any Tapas created by the user. To create one, they can press a "New Tapas" button, sending them to exactly this EditTapasView with a newly ...
0
votes
1
answer
29
views
Struggling with async/await: Fetching an image off the main thread while updating UI
I’m learning async/await and trying to fetch an image from a URL off the main thread to avoid overloading it, while updating the UI afterward. Before starting the fetch, I want to show a loading ...
0
votes
0
answers
13
views
SideMenu Items Navigation in swiftUI
I just want to asked about the side Menu items navigation Now the Main point is my app has 4 tabs suppose tab1,tab2,tab3,tab4 so in tab1 screen i open and close the side Menu this works prefectly but ...
-1
votes
0
answers
13
views
Is it possible to connect a single third party UWB device (hardware or chip) to multiple iPhones at the same time?
I am interested in UWB technology and I am trying to build a dummy indoor navigation project.
I will be placing 3 third party UWB devices (hardware or chips) in some distance apart from each other.
...
0
votes
1
answer
11
views
keyboard not load and Display
My whole project keyboard not visible but i click in bottom to enter text what is issue??
to check my images to see ?? check image
to check my videos to see ??text(see video)
I think keyboard not ...
0
votes
0
answers
10
views
Decoding error -8969 (bad data) for HLS live stream
currently I'm trying to decode a HLS livestream with VideoToolbox. The CMSampleBuffer is successfully created (OSStatus == noErr). When I enqueue the CMSampleBuffer to a AVSampleBufferDisplayLayer the ...
0
votes
1
answer
28
views
Swift - mutate struct after downcast
This is the abstraction of my code:
protocol MyProtocol {
var value1: Int {get set}
var value2: Int {get set}
}
struct MyStruct: MyProtocol {
var value1: Int = 1
var value2: Int = 2
...
0
votes
0
answers
41
views
Swift Date relationship, deleted object after after reopen app [duplicate]
i have issue with objects.I have models
@Model
class Tag {
var id: UUID
var title: String = ""
var color: Int = 0xFFFFFF
init( title: String, color: Int ) {
...
0
votes
1
answer
21
views
If your goal is to only have only one long running task running at a time is it safe to cancel then immediately create a new one?
I have the following polling task. Its roughly exactly like this but obviously a bit contrived to make the question simple.
class SocketClass {
private var pollingTask: Task<Void, Never>?
...
1
vote
2
answers
41
views
Sharing same function between two view models?
I have a view which I use throughout my app on various pages. The view shows an image and a label, in this case the city name.
import SwiftUI
import Kingfisher
struct CityView: View {
@...
0
votes
0
answers
14
views
How to provide entitlements to an external v2ray binary for macos app in xcode?
App sandbox not enabled. The following executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true in the entitlements property list: [( "...
0
votes
1
answer
41
views
StoreKit Product.products(for:) works inconsistently: Task.detached resolves the issue—why?
I’m implementing in-app purchases using StoreKit in my SwiftUI app, but I’ve encountered an issue where Product.products(for:) inconsistently returns an empty array. No errors are thrown, and ...
0
votes
1
answer
39
views
SwiftUI "mask" left and right portions of a view
I have a rounded rectangle and I wish to mask the left and right portions of it (whose widths can be custom defined as State variables). What I want is the rounded rectangle to preserve it's rounded ...
0
votes
0
answers
51
views
How to asynchronously initialize property of an actor [closed]
This code produces error:
"Actor-isolated property 'preferences' can not be mutated from a nonisolated context" at the init() block.
Goal is to have user preferences loaded before any of ...
-2
votes
0
answers
22
views
Can’t get DepthImage or AVPortraitEffectsMatte [closed]
I am trying to fetch images from the user's photo library on iOS and I want to filter out only the photos that were taken using an iPhone (specifically with the Apple Camera app). How can I achieve ...
0
votes
0
answers
22
views
Issue with Share Component using Expo and React
I'm trying to implement sharing from the gallery for my app and using the following component
https://ajith-ab.github.io/react-native-receive-sharing-intent
It works great with android but I'm getting ...
0
votes
0
answers
20
views
Core ML prediction for Image Classification Create ml model predict same result for different images
I am exploring the Apple Core ML framework.
I created a training model using Create ML app. Image Classification to identify the image is cat or a dog. The data set I used is referred from
https://www....
0
votes
0
answers
15
views
Playing Bar on iPhone Lock Screen Shows Blank Play/Pause Icon and Missing Logo
I implemented code to display a media playing bar on the iPhone lock screen for my app. The functionality is mostly working—I'm able to see the playing bar, and the play/pause button is clickable.
...
0
votes
0
answers
33
views
How to Check if Notification Mirroring is Enabled?
I am working on a Swift 5 app and need to determine if notification mirroring is enabled. Specifically, I want to check if notifications from the iPhone are being mirrored to connected devices like ...
0
votes
0
answers
31
views
Steps to request oEmbed Read permissions for a Facebook app
I want to render an Instagram post in a web view on a iOS swift app and for that I intend to use the oEmbed Read API which gives me back the HTML that I can render on a webview.
I have created a ...
-1
votes
0
answers
59
views
Get credit card information via NFC on iOS Swift [closed]
I am developing an iOS app and would like to scan smart cards (such as debit or credit cards) via NFC and extract information such as the card number, cardholder name, card type (e.g., Visa, ...
0
votes
1
answer
62
views
Running a function in a background thread in Swift IOS
I am a beginner to swift and ios development and need some help with structured concurrency. I need a long running function to execute on a background thread, and be cancelled if it is called again ...
0
votes
0
answers
28
views
Load Flutter assets in iOS
I am trying to load an asset in my iOS Swift Code inside a WidgetExtension. I found this documentation but the code seems to be deprecated.
With this the project builds:
let assetPath = "assets/...
0
votes
1
answer
37
views
How to force empty UITextView to be scrollable using a Swift UI view representable
For the purposes of an app I'm building I need a text editor that fills the phone screen, and is always scrollable.
Since I'd like some extra control over the formatting of text and scroll behaviour ...
0
votes
1
answer
40
views
How to bypass system volume on audio player?
How can I ignore the system volume so that when an MP3 is played and, for example, the iPhone's volume is set to 5%, the AudioPlayer's volume is always at 100%?
Currently, the Audio Player adjusts to ...
-4
votes
0
answers
40
views
“Xcode Build Conflict: Duplicate File Output Issue” [closed]
enter image description here“I’m encountering an issue in Xcode where files like Info.plist and AppCoordinator.stringsdata are being duplicated during the build process. This conflict causes the build ...
-1
votes
0
answers
14
views
In iOS, Change accessibility text of a UIView element based on the focus direction
Can the accessibility text of a UIView be changed based on the direction the focus it received.
Example:
if the focus on the view is received from the top, the text should be 'abc'.
if the focus on ...
0
votes
1
answer
54
views
Change Swift dock icon at runtime
I'm trying to change SwiftUI app icon at runtime on macOS using the following code:
import SwiftUI
@main
struct projApp: App {
init() {
print("Initializing application...")
...
-1
votes
0
answers
49
views
iOS: Writing multiple values to the Keychain atomically
Is there any way to write multiple values to the keychain atomically, in a single transaction to guarantee that they are all written successully, or in the event of any failure, none of them are ...
-2
votes
0
answers
16
views
Is it possible to unit test BGAppRefreshTask? [closed]
We are implementing BGAppRefreshTask in our iOS Swift project.
Can we write unit test for the scheduling method and also the handler methods
0
votes
0
answers
33
views
mimic photos app collectionview spacing when not scrolling
Please use this gif as reference for expected result
Work is in progress and public in this github
I'm using default UICollectionViewFlowLayout and set custom sizing for the selected cell when ...
0
votes
0
answers
33
views
Why does spline animation stop when getting out of the screen
Basically my problem seems very simple but I can't find an answer, I have multiple structs and they just have a spline.design. These designs that I made have some animations plus they allow to zoom in ...
0
votes
0
answers
25
views
GFPGAN CoreML model isn't working correctly
I tried downloading the GFPGAN CoreML model from hoseins77/gfpgan and TheMurusTeam/coreml-upscaler-gfpgan, but when I used it in my project, the outputted images did not come out right. GFPGAN appears ...
-2
votes
0
answers
33
views
How to determine the latitude and longitude of a sighting at sea level from a raised point on land [closed]
First off, I am new to Swift, but have been a software systems engineer for the last 40 years. I am fluent in C, C++, Java and Python.
I have implemented a version of the following solution in Python ...
-4
votes
0
answers
38
views
Moving library to CocoaPods causes headers to not be found [closed]
wanting to understand the mechanics of an issue I keep facing.
Working on a legacy objc project and have added CocoaPods and moving libraries into pods. Today I moved Lottie-ios and in all of the ...
0
votes
0
answers
64
views
Method swizzling and test coverage
I'm trying to use method swizzling (@_dynamicReplacement) to implement unit test without mocks.
Everything works perfectly except for the test coverage, which becomes 0% for the original method.
Can ...
-3
votes
0
answers
125
views
How to stop Animation in SwiftUI Resets Position After Window Resize and App Relaunch?
In SwiftUI, an animation is set to trigger on a view's appearance, specifically a rotation effect centered on the view. However, after resizing the app window or relaunching the app, the animation ...
0
votes
0
answers
30
views
Why FCM token is no more received by the "didReceiveRegistrationToken" delegate
Here is our app situation:
We have one iOS app (same bundle ID) that can connect to either a North American (NAM) Firebase project or an European (EU) one that is selected based on phone's region.
...
0
votes
1
answer
31
views
Test flight app crash after device is locked for few minutes - After Intune iOS SDK integration
When the app integrated with Intune SDK is locked on an iOS device for around 20-30 minutes and then reopened, the app shows a black screen or Intune lock screen and crashes. A popup appears stating, &...
0
votes
0
answers
63
views
UMPConsentForm in iOS is present in view hierarchy even when not presented to user, posing accessibility issue
I am doing an accessibility optimization for iOS, but running into the issue that the UMPConsentForm is present in the view hierarchy, even when it is the back window that is not seen and also it was ...
3
votes
0
answers
45
views
XCode 16 Swift Interoperability - Function type mismatch, declared as '@convention(thin)
I was using Swift CPP interoperability in XCode 15.
I used the code below to call and pass data from the CPP to the Swift side.
IN CPP:
class VideoPropertiesObserver {
public:
void (*...
0
votes
2
answers
149
views
Getting 'Fatal error index out of range' in two layer Lazy Stack with using ForLoop SwiftUI
I have an array of elements that contains a nested array of other elements inside.
When deleting a row of an array, sometimes a crash occurs with the message
'Swift/ContiguousArrayBuffer.swift:600: ...
0
votes
1
answer
28
views
Extension to a generic class in Swift, where the generic parameter is also generic
It's easier to explain the problem on an example. For instance, consider this simple generic class:
final class GenericClass<T> {
private let parameter: T
init(parameter: T) {
self....
0
votes
0
answers
23
views
iOS: Declare tracking if it's disabled completely in third-party SDK
I have an app where I'm integrating the Branch.io SDK which I plan to use only for deeplinks. The SDK provides it's own privacy manifest file with privacy tracking domains defined and some collected ...
0
votes
1
answer
42
views
Why does Core Animation have a delay compared to Core Graphics?
I am trying to implement a custom UISlider on an iOS device.
First, the ThumbSlider is positioned on both ends, and the desired behavior is as follows: When the ThumbSlider moves left or right, the ...
0
votes
0
answers
49
views
Avoid "jumpy" animation when swipe between different pages in TabView
I have the following TabView
TabView(selection: $currentTab) {
ForEach(0...(quizViewModel.quizzes.count), id: \.self) {
if $0 < quizViewModel.quizzes.count {
quizSide(index: ...
0
votes
1
answer
58
views
ProgressView not showing in MenuBarExtra
The issue
I'm having trouble having a linear ProgressView show in a MenuBarExtra, it would simply not appear.
Apparently, there is no counter-indication indicating that it is impossible to do so but I ...
1
vote
0
answers
73
views
How to Create a Calendar Grid in SwiftUI Where Each Month Has Correct Number of Days and Empty Cells for Invalid Dates?
I am trying to create a dynamic calendar in SwiftUI, where I display each month with the correct number of days, starting from the correct weekday (e.g., December 1st should be under Thursday). The ...
-2
votes
1
answer
73
views
How can I dynamically adjust the zIndex to keep a dragged rectangle on top without using arbitrary zIndex values?
When dragging a rectangle from the upper HStack (red rectangle) to the lower HStack, the dragged rectangle goes behind the views of the lower HStack, despite adjusting the zIndex with (.zIndex(...
0
votes
0
answers
43
views
How To Reference One Asset File In For Assets
I recently discovered that with iOS 18, when displaying alternative icons in your app, you can no longer use Image(uiImage: UIImage(named: name)) as UIImage(named: name) now just returns nil (see here ...