336,311 questions
0
votes
0
answers
18
views
CLGeocoder deprecation: How can I obtain geocoding bounds in MapKit?
I am currently using CLGeocoder in weather app on iOS to handle user's location queries. I then use the region property of the resulting CLPlacemark objects to obtain the region corresponding to the ...
Advice
0
votes
4
replies
19
views
CLGeocoder deprecation - How can I obtain geocoding bounds in MapKit?
I am currently using CLGeocoder in weather app on iOS to handle user's location queries. I then use the region property of the resulting CLPlacemark objects to obtain the region corresponding to the ...
0
votes
0
answers
44
views
How can I show a movable webcam preview above all windows in macOS without activating the app
I'm building a macOS app using SwiftUI, and I want to create a draggable floating webcam preview window
Right now, I have something like this:
import SwiftUI
import AVFoundation
struct ...
0
votes
0
answers
45
views
iOS 26.1: In TabView, NavigationStack animation breaks when intercepting tab selection to show fullScreenCover
I'm trying to show a fullScreenCover when the user taps the third tab instead of actually switching to that tab. The issue is that resetting selectedTab = oldValue in onChange breaks the ...
1
vote
0
answers
54
views
Using @Environment inside a ViewModifier causes a deep SwiftUI crash — is my theme setup fundamentally wrong?
I use a custom AppTheme type and inject it via a custom EnvironmentKey. Views can access the theme using @Environment(\.appTheme) or override it explicitly.
While this work fine in most cases it ...
0
votes
1
answer
47
views
Facebook iOS SDK App switch login not working
I've issue in v18.0.2 when my app switch to facebook app.
I'm using AppDelegate.
My issue is only user authorize open Facebook App, user authorize in WebView is fine.
I research and tried a lot but ...
-2
votes
0
answers
59
views
JSON decoding issue [duplicate]
I have a sample JSON that I am trying to decode to models in my Swift. But it keeps failing and giving me error:
Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError....
-3
votes
1
answer
42
views
How can we disable swipe back to dismiss a UIViewController in iOS 26? (UIKit)
This doesn't work anymore on iOS 26 to disable swipe back in a navigation controller:
interactivePopGestureRecognizer.isEnabled = false
How can we disable swipe back to dismiss a UIViewController in ...
-1
votes
1
answer
84
views
Flutter app shows black screen on iOS device (works on Android, no errors)
I'm trying to run my Flutter app on a real iOS device.
The app installs successfully, Firebase initializes, and logs show normal navigation (Splash → Onboarding).
But the screen becomes completely ...
0
votes
1
answer
70
views
Custom bottom sheet shows brief flicker/fade of underlying view when expanding/collapsing (iOS 15)
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’...
1
vote
1
answer
62
views
Custom strokeStyle lineCap with corner radius [duplicate]
I want to be able to give these ends a corner radius of 5 instead of sharp square ends.
lineCap only supports .round, .butt and .square
How can I create a custom corner radius for the lineCap?
Here is ...
2
votes
1
answer
64
views
Saving password in passwords app is NOT working if I have password and confirm password textfield Swift IOS 26
I am implementing a "save password" feature on sign up, where I have 3 text fields: Username, password and confirm password.
My problem is if I remove "confirm password" text field,...
0
votes
0
answers
36
views
iOS Firebase appears to hang due to StoreKit (which isn't being used)
In the past few weeks something apparently has changed with xcode/Apple which is causing our iOS regression tests to hang on authentication using Firebase.
Googling the interleaved log error Error ...
Advice
0
votes
2
replies
43
views
CloudKit data initial share sheet in Swift UI and iOS 26
Let's use a basic todo app as an example - sharing a todo list. I have a share button (square with up arrow) that when the user taps I want the initial share sheet to appear. If I have to create and ...
1
vote
0
answers
55
views
Multi-line title in UIButton in a UITableViewHeaderFooterView causes UIViewAlertForUnsatisfiableConstraints warnings
I need to show occasional long texts in a UIButton in the section header of my UITableView. The following simple example code shows the issue:
import UIKit
import SnapKit
class ViewController: ...
1
vote
1
answer
106
views
List view bottom edges not being clipped ios 26
before updating to iOS 26 my list was looking fine but now it has abnormal paddings and because I am using fixed height, I had to increase the height from 40 to 60 to fit the text.
There are currently ...
2
votes
1
answer
63
views
How to add a working custom button to AVPictureInPictureController?
I saw a cool feature on YouTube for playing instream ads directly in the system pip
I wanted to repeat their functionality. I was able to add a regular UILabel, but I had problems with the UIButton. ...
-3
votes
0
answers
58
views
Small navigation title is not appearing on scroll [duplicate]
When my view controllers appears, large navigation title is appearing. But when I scroll, then small navigation title is not appearing. I am facing this issue only in iOS 26. In older iOS versions, ...
-1
votes
1
answer
56
views
Protocols and covariance - How to enable LSP in swift? [duplicate]
I want to keep some graph traversal algorithms as generic as possible and define a protocol for this purpose:
protocol Path {
var distance : Int { get}
var end : Node { get }
init (start:...
0
votes
0
answers
41
views
no products or categories on the ViewController in TableView in iOS app with api woocommerce
I begin to create online shop iOS app with connection to site on Woocommerce. I want to insert in TableView products from Woocommerce via API.
Now then I Build the app, simulator launch only white ...
-3
votes
0
answers
70
views
In UIKit, is the behavior of detached Task exactly as described in this example?
I have this code:
func drawCount() {
Task {
await _drawCount()
}
}
func _drawCount() async {
let k = await Task.detached(priority: .low) {
return gfed.filter{$0.blah}....
0
votes
1
answer
43
views
Create an .xcframework from Swift Package with binaryTarget
I need to pack an API that depends on a C binary into a single xcframework.
This task seems to be quite tricky because I cannot find any helpful resources. I don't know how to proceed.
I have a ...
0
votes
0
answers
43
views
Facing an error of Swift.String : Swift.Error in heresdk
I have Project where I have already integrated heresdk since 2 years back and it is working fine but when I update to latest heresdk then it gives an following error
protocol conformance descriptor ...
3
votes
1
answer
100
views
+50
RealityKit's custom light entity causes a black artifact on my 3D model
I’m working with RealityKit and I’m seeing a strange black artifact appear in the center of my rendered model. Here’s the relevant code:
let camera = PerspectiveCamera()
camera.transform = ...
0
votes
0
answers
56
views
Container Failing to Initialize After a Successful Migration & Initialization
I'm experiencing the following error with my SwiftData container when running a build:
Code=134504 "Cannot use staged migration with an unknown model version."
Code Structure - Summary
I ...
2
votes
1
answer
67
views
Remote notification tap not handled when app is killed
I’m running into an issue with remote push notifications on iOS.
When the app is in background or inactive, tapping a notification correctly triggers:
userNotificationCenter(_:didReceive:...
0
votes
1
answer
50
views
How to print async properties in LLDB?
private var maximumDistanceForTrailingHandle: CGFloat {
get async {
return ...
}
}
(lldb) po maximumDistanceForTrailingHandle
warning: <EXPR>:11:7: initialization of variable '$...
1
vote
1
answer
49
views
.alert inside .fullScreenCover is immediately dismissed when used inside specific view hierachy
I have created a reusable ModalDialog view that presents modal content via .fullScreenCover. Inside this dialog, a button triggers a SwiftUI .alert.
This works fine in many situations. However, in a ...
-1
votes
1
answer
70
views
How to reduce top padding of NavigationBar to match native Apple apps? [closed]
When I use navigationTitle in SwiftUI, the top padding becomes too large. However, in Apple’s own apps the top area is noticeably smaller and more compact. How can I achieve the same native look with ...
0
votes
0
answers
23
views
Why Swift Testing require execution in MainActor? [duplicate]
The code below is located in the application module:
enum API {}
extension API {
protocol Endpoint: Sendable {
var basePath: String { get }
var apiName: String { get }
var ...
Advice
1
vote
5
replies
79
views
How to wrap C-library into SwiftPackage to use in my project?
I created test project - "TaoTester" and test package with C-library called "SwiftGit2".
After few days of work in package almost all works fine....
EXCEPT: I cannot link C-...
1
vote
1
answer
84
views
How can I migrate NotificationCenter code to Swift 6 concurrency?
I’m migrating a NotificationManager class to Swift 6. This class is a small utility wrapper around NotificationCenterand has a method that lets users register a notification that will triggerunless ...
0
votes
1
answer
83
views
CKQueryOperation parse Array from public database [closed]
The operation:
operation.recordMatchedBlock = {recordID, result in
switch result {
case .success(let record):
print("RecordID: \(recordID), record: \(record)")
let ...
0
votes
1
answer
26
views
RealityKit CollisionFilter: left and right child colliders both firing when only one is touched
I’m working with RealityKit and trying to detect on which side of a connector a sphere has collided.
The setup:
I have a connector (a cylinder).
It has two child entities, each one with its own ...
2
votes
1
answer
91
views
Incorrect display of the TabBar when selecting a tab with scroll view inside
I'm trying to implement a tab bar on iOS 26 like the Music or Health apps on iPhone.
On a white background this is not noticeable, but when changing the background color to dark at the start of the ...
0
votes
2
answers
64
views
Number equivalents for Apple's StoreKit errors
Where do I find the actual numbers that match Apple's billing StoreKit errors?
For example, I know that if I get a 2, that's paymentcancelled, but I don't know what the other numbers mean. I'm not ...
-3
votes
0
answers
34
views
How to use custom version of swift in Xcode? [duplicate]
I am using Mac 14 and the highest version of Xcode that I can install is 16.2
And it comes with the bundled swift component - 6.0.3 version.
But my project requires swift 6.2 or later.
I was able to ...
1
vote
1
answer
95
views
iOS 26: UIScrollView topEdgeEffect not applied
I am trying to use the topEdgeEffect API in iOS 26, but even setting the effect style to ".soft" does not work:
class ViewController: UIViewController {
var scrollView: UIScrollView!
...
2
votes
1
answer
81
views
SwiftData update causes render with initial data overwriting changes
I'm working on a SwiftUI app using SwiftData, and I'm very new to both frameworks, and swift in general to be honest. I'm trying to create a webview that embeds a monaco editor that will then send the ...
2
votes
2
answers
120
views
Difference in Double representation between Kotlin and Swift
In Kotlin, if you do println(String.format("%.17f", 10.45)), you will see 10.45000000000000000 in the output.
In Swift, if you do print(String(format: "%.17f", 10.45)) you will see ...
0
votes
0
answers
63
views
How to implement long press (minimum duration) for iOS widget buttons?
I've seen apps that have interactive widget buttons where a short tap does nothing, but holding the button for at least 1 second executes the action. This can be configured per button in the widget ...
0
votes
0
answers
27
views
Swift can’t load resource folder at runtime (“No such file or directory”) even though files are added to Xcode [duplicate]
I'm building a macOS app in SwiftUI and I'm trying to load a folder called Wallpapers that I added to my Xcode project.
The folder contains subfolders (categories) and each category contains wallpaper ...
1
vote
0
answers
38
views
Custom UITabBar badge color ignored when switching to Map tab in iOS 18+
I found a reproducible issue in iOS 18+. When a SwiftUI TabView contains a Map (MKMapView), any custom UITabBarAppearance badge color is ignored while that tab is active. As soon as you switch to a ...
1
vote
1
answer
56
views
How to create a SwiftUI Menu with multiple Pickers without extra dividers?
I'm trying to create a SwiftUI Menu containing two Picker to control content and sort. However, I cannot replicate menu appearance shown in my reference screenshot.
No matter which approach I try, I ...
1
vote
2
answers
91
views
SwiftUI @FocusState doesn’t focus a desired TextField
I have a SwiftUI view with multiple TextFields and a @FocusState bound to my view model. I want the first field to automatically get focus whenever the view appears(when coming back from a SecondView)....
0
votes
1
answer
68
views
How to present app-wide alerts/sheets above existing sheets in SwiftUI (central presenter like UIKit)?
TL;DR: my app has some global alerts and modals (e.g. hints about trial limits, the in-app purchase screens, etc.) which should be available through out the app. In UIKit I could always present alerts ...
0
votes
0
answers
59
views
iOS26 AVSampleBufferDisplayLayer crash
libobjc.A.dylib _objc_retain_x0 16
AVKit -[AVSampleBufferDisplayLayer(AVPictureInPictureSuppport) avkit_sampleBufferDisplayLayerPlayerController] 36
AVKit -[AVSampleBufferDisplayLayer(...
0
votes
0
answers
33
views
XCode StoreKit helper application failure - Purchase Fails with NSCocoaErrorDomain Code=4099 and ASDErrorDomain Code=5115
XCode version = 26 && macOS version = 26
Running the app from XCode (not in release mode)
I want to implement in app purchases for my macOS application, for that i want to first test it ...
Best practices
1
vote
1
replies
38
views
Check if specific date is at least tomorrow in Swift
What is the best way to properly check if a date is at least tomorrow?
So far I was able to come up with this solution, but I'm not 100% sure it's correct:
let calendar = Calendar.current
func ...
0
votes
0
answers
34
views
iOS EXC_BAD_ACCESS when launching HyperVerge KYC camera from React Native Expo app (Android works)
I’m integrating HyperVerge as my KYC provider in a React Native + Expo app.
On Android everything works fine. On iOS, the flow is:
HyperVerge captures the user’s face successfully
When the SDK asks ...