id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79795513 | stackoverflow | MOBILE_DEVELOPMENT | Navigation header disappears with custom background color in Form view on iOS 26 SDK | Navigation header disappears with custom background color in Form view on iOS 26 SDK
I am encountering an issue when building my SwiftUI app with the iOS 26 SDK. When I use a custom background color for the navigation bar in a Form view, the navigation header disappears. This only happens with custom colors (e.g., Col... | https://stackoverflow.com/questions/79795513/navigation-header-disappears-with-custom-background-color-in-form-view-on-ios-26 | ios, swift, swiftui, ios26 | 1,761,028,602 |
se_79796631 | stackoverflow | MOBILE_DEVELOPMENT | How to refresh APNs token automatically after device restore without requiring the user to open the app? | How to refresh APNs token automatically after device restore without requiring the user to open the app?
When an iOS device is restored from another device (e.g., Device A → Device B), the old APNs token becomes invalid. The token is only refreshed once the app is opened and registerForRemoteNotifications() is called ... | https://stackoverflow.com/questions/79796631/how-to-refresh-apns-token-automatically-after-device-restore-without-requiring-t | ios, swift, push-notification, apple-push-notifications, appdelegate | 1,761,126,501 |
se_79871267 | stackoverflow | MOBILE_DEVELOPMENT | Triggering iOS Notifications Based on Settings Change | Triggering iOS Notifications Based on Settings Change
I have an app that requires permissions and I want to generate a local notification if any of the permissions (e.g. screen time) are revoked to let the user know that the app won't work until they take action.
I have been trying other apps that use similar permissi... | https://stackoverflow.com/questions/79871267/triggering-ios-notifications-based-on-settings-change | ios, swift, iphone, swiftui | 1,768,833,537 |
se_60500508 | stackoverflow | MOBILE_DEVELOPMENT | custom back button in navigation in iOS | custom back button in navigation in iOS
I know this question has been asked before but nothing worked for me and I had to ask it again.
I want an image as my back button in navigation bar, just want to change the appearance of the back button. I don't want to add a button and add selectors for it.
I tried the followi... | https://stackoverflow.com/questions/60500508/custom-back-button-in-navigation-in-ios | ios, swift, xcode | 1,583,212,517 |
se_79874406 | stackoverflow | MOBILE_DEVELOPMENT | .accessibilityShowButtonShapes deprecated - How to correctly handle conflicts with .glassEffect? | .accessibilityShowButtonShapes deprecated - How to correctly handle conflicts with .glassEffect?
My app supports iOS 16+ In order to support Glass in iOS 26, I created some custom modifiers to only add Glass when available.
While this works fine in general some users reported problems when using the accessibility feat... | https://stackoverflow.com/questions/79874406/accessibilityshowbuttonshapes-deprecated-how-to-correctly-handle-conflicts-wi | ios, swift, swiftui | 1,769,158,369 |
se_58587784 | stackoverflow | MOBILE_DEVELOPMENT | Is ti possible to `map` an enum to Binding<Bool> in SwiftUI? | Is ti possible to `map` an enum to Binding<Bool> in SwiftUI?
Working with MVVM in SwifUI. My aim is to have an enum state property in the ViewModel so the View could adjust it self according to the state property. States could be: idle, busy, done and error. On done I want to navigate to another screen using Nav... | https://stackoverflow.com/questions/58587784/is-ti-possible-to-map-an-enum-to-bindingbool-in-swiftui | ios, swift, swiftui | 1,572,251,933 |
se_79874183 | stackoverflow | MOBILE_DEVELOPMENT | Why does my iOS Live Activity countdown widget crash when its ActivityStatus changes to stale? | Why does my iOS Live Activity countdown widget crash when its ActivityStatus changes to stale?
I am creating a Live Activity widget that counts down to a future event. When starting the Live Activity, I set its staleDate to be equal to the date of the future event. This allows me to update the UI of the widget even if... | https://stackoverflow.com/questions/79874183/why-does-my-ios-live-activity-countdown-widget-crash-when-its-activitystatus-cha | ios, swift, swiftui, widgetliveactivity | 1,769,124,100 |
se_57437778 | stackoverflow | MOBILE_DEVELOPMENT | How to display current page using PDFKit on Swift | How to display current page using PDFKit on Swift
When using PDFKit, what's the proper way of obtaining the updating current page?
For example, implementing an overlay view with a small box on the top or bottom of the page displaying Page 1 of 20 and have this value update when the user scrolls? | https://stackoverflow.com/questions/57437778/how-to-display-current-page-using-pdfkit-on-swift | swift, pdf, pdfkit | 1,565,389,604 |
se_77747190 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI weird behaviour when using `safeAreaInset` modifier in `NavigationStack` | SwiftUI weird behaviour when using `safeAreaInset` modifier in `NavigationStack`
Trying to make header pinned between below the navigation bar using safeAreaInset modifier. When I start swiping navigation bar down, the safeAreaInset content remains on the same position although navigation title and List content moves ... | https://stackoverflow.com/questions/77747190/swiftui-weird-behaviour-when-using-safeareainset-modifier-in-navigationstack | swift, swiftui | 1,704,211,213 |
se_60359808 | stackoverflow | MOBILE_DEVELOPMENT | How to access own window within SwiftUI view? | How to access own window within SwiftUI view?
The goal is to have easy access to hosting window at any level of SwiftUI view hierarchy. The purpose might be different - close the window, resign first responder, replace root view or contentViewController. Integration with UIKit/AppKit also sometimes require path via wi... | https://stackoverflow.com/questions/60359808/how-to-access-own-window-within-swiftui-view | ios, swift, macos, swiftui | 1,582,440,425 |
se_79872752 | stackoverflow | MOBILE_DEVELOPMENT | How to create a type-specific and file-private reusable modifier for DatePicker in SwiftUI? | How to create a type-specific and file-private reusable modifier for DatePicker in SwiftUI?
I am looking for a clean way to refactor redundant modifiers for DatePicker in SwiftUI.
In my ContentView.swift, I have multiple DatePickerviews that share the exact same styling. To keep my code DRY, I want to group these modi... | https://stackoverflow.com/questions/79872752/how-to-create-a-type-specific-and-file-private-reusable-modifier-for-datepicker | swift, swiftui, refactoring, extension-methods | 1,768,991,224 |
se_71094778 | stackoverflow | MOBILE_DEVELOPMENT | Xcode: Own Swift packages missing in Schema selector | Xcode: Own Swift packages missing in Schema selector
I have some SPM swift packages as part of my swift project.
After some Xcode crashes, those packages don't appear in the Schema selector (black arrow in image) any more.
So I can't select and build the swift packages any more separately.
What can I do to fix this? | https://stackoverflow.com/questions/71094778/xcode-own-swift-packages-missing-in-schema-selector | swift, xcode, swift-package-manager | 1,644,690,986 |
se_79873103 | stackoverflow | MOBILE_DEVELOPMENT | ASAuthorizationControllerDelegate always returns .canceled for Face ID passcode fallback and failed attempts | ASAuthorizationControllerDelegate always returns .canceled for Face ID passcode fallback and failed attempts
I’m implementing Sign in with Apple / Passkeys using ASAuthorizationControllerDelegate and handling errors via:
func authorizationController(
controller: ASAuthorizationController,
didCompleteWithErr... | https://stackoverflow.com/questions/79873103/asauthorizationcontrollerdelegate-always-returns-canceled-for-face-id-passcode | ios, swift, iphone, authentication, passkey | 1,769,017,780 |
se_79872221 | stackoverflow | MOBILE_DEVELOPMENT | iOS and WatchOS app sharing the same dynamic framework | iOS and WatchOS app sharing the same dynamic framework
I have not been able to share a single dynamic framework between my iOS and WatchOS 10 apps. This single framework supports both platforms and builds for each, but when depending on it in the watch app itself, it results in build failures. | https://stackoverflow.com/questions/79872221/ios-and-watchos-app-sharing-the-same-dynamic-framework | swift, xcode, watchos | 1,768,931,091 |
se_79774465 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26: menu label disappears when showing menu contents | iOS 26: menu label disappears when showing menu contents
I have a menu in my SwiftUI app with a card view as label. Prior to iOS 26, opening the menu looked like this:
Note how the menu label (the card w/ shadow) remains visible as it should.
Now, after running the app on the new Xcode for iOS 26, the menu label (car... | https://stackoverflow.com/questions/79774465/ios-26-menu-label-disappears-when-showing-menu-contents | ios, swift, swiftui, ios26 | 1,758,783,532 |
se_79872919 | stackoverflow | MOBILE_DEVELOPMENT | removeAll method is triggering an observation change even though array is unchanged | removeAll method is triggering an observation change even though array is unchanged
Recently I have noticed an interesting thing when using the Observable annotation. I have a model marked with Observable, and there is an array in the model, at some point I call the removeAll on this array using a where condition, and... | https://stackoverflow.com/questions/79872919/removeall-method-is-triggering-an-observation-change-even-though-array-is-unchan | arrays, swift, swiftui, observation-framework | 1,769,003,435 |
se_46666322 | stackoverflow | MOBILE_DEVELOPMENT | Images being flipped when adding to NSAttributedString | Images being flipped when adding to NSAttributedString
I have a strange problem when resizing an image that's in a NSAttributedString. The resizing extension is working fine, but when the image is added to the NSAttributedString, it gets flipped vertically for some reason.
This is the resizing extension:
extension N... | https://stackoverflow.com/questions/46666322/images-being-flipped-when-adding-to-nsattributedstring | swift, macos, cocoa, nsattributedstring, nsimage | 1,507,637,058 |
se_79872716 | stackoverflow | MOBILE_DEVELOPMENT | Getting "The connection to service named com.apple.VideoSubscriberAccount.videosubscriptionsd was invalidated" on requestAutoSignInAuthorization | Getting "The connection to service named com.apple.VideoSubscriberAccount.videosubscriptionsd was invalidated" on requestAutoSignInAuthorization
I need to implement automatic sign-in in a tvOS app using new VSUserAccountManager functions added in tvOS 26. This code
let accountManager = VSUserAccountManager.s... | https://stackoverflow.com/questions/79872716/getting-the-connection-to-service-named-com-apple-videosubscriberaccount-videos | swift, sandbox, tvos, apple-tv | 1,768,989,070 |
se_28932693 | stackoverflow | MOBILE_DEVELOPMENT | Change the tint color of the ActionSheet that appears when you long tap on a link in a WKWebView | Change the tint color of the ActionSheet that appears when you long tap on a link in a WKWebView
I'm writing an iOS 8 app and this problem is driving me crazy... I've set the tint color of my window in white (because I've got colored toolbar and navigation bar) but now, when in my WKWebView I long press on a Link, the... | https://stackoverflow.com/questions/28932693/change-the-tint-color-of-the-actionsheet-that-appears-when-you-long-tap-on-a-lin | swift, ios8, webkit, uiactionsheet, wkwebview | 1,425,853,811 |
se_63247857 | stackoverflow | MOBILE_DEVELOPMENT | How to authenticate with Apple SSO (TV Provider) using VideoSubscriberAccount framework | How to authenticate with Apple SSO (TV Provider) using VideoSubscriberAccount framework
I need to implement authentication scheme using Apple SSO for my application:
Check for an signed user in Settings TV Provider
Sing in into TV Provider from my app if there is no a signed user
Get authentication payload of a signe... | https://stackoverflow.com/questions/63247857/how-to-authenticate-with-apple-sso-tv-provider-using-videosubscriberaccount-fr | ios, swift, authentication, single-sign-on, saml | 1,596,547,402 |
se_79872049 | stackoverflow | MOBILE_DEVELOPMENT | How to remove the line under a SwiftUI Slider? | How to remove the line under a SwiftUI Slider?
I use a Slider in SwiftUI:
import SwiftUI
struct TestSliderView: View {
@State var minExpDuration: Double
let minExpDurationRange: ClosedRange<Double> = 200...3000
var body: some View {
minExpDurationSlider
}
private var minExpDurati... | https://stackoverflow.com/questions/79872049/how-to-remove-the-line-under-a-swiftui-slider | swift, swiftui, slider, ios26 | 1,768,918,572 |
se_78192688 | stackoverflow | MOBILE_DEVELOPMENT | How to make an Actor's isolated state observable | How to make an Actor's isolated state observable
Suppose there's an actor like below
actor MyActor<State> {
private var state: State
private init(initialState: State) {
self.state = initialState
}
public func message(param: Int) {
// mutates state
...
}
}
Now ... | https://stackoverflow.com/questions/78192688/how-to-make-an-actors-isolated-state-observable | swift, actor, combine | 1,710,931,947 |
se_77813315 | stackoverflow | MOBILE_DEVELOPMENT | SwiftData Model Inheriting from Codable Class | SwiftData Model Inheriting from Codable Class
I have a backend written in swift (hosted on GCP Cloud Run, aka linux so no access to Apple-specific frameworks).
I have a regular codable class:
open class MyClass: Codable, Identifiable {
var id: String
var name: String
init(id: String, name: String) {
... | https://stackoverflow.com/questions/77813315/swiftdata-model-inheriting-from-codable-class | swift, codable, swiftdata | 1,705,184,829 |
se_56022283 | stackoverflow | MOBILE_DEVELOPMENT | Resize 3d cube base on screen size | Resize 3d cube base on screen size
let's say I have a 3d cube of this size.
Height: 1002.0
Width: 564.0
The cube size is based on image size, here's how I'm creating the cube:
let image = UIImage(named: "img")
artRoomScene.setup(height: image!.size.height / 600, width: image!.size.width / 600, position: SCNVe... | https://stackoverflow.com/questions/56022283/resize-3d-cube-base-on-screen-size | swift, scenekit | 1,557,230,828 |
se_79871613 | stackoverflow | MOBILE_DEVELOPMENT | What causes the view modifier to be used when a view calls its body? | What causes the view modifier to be used when a view calls its body?
I was exploring SwiftUI's diffing mechanism when I encountered this situation. According to WWDC (Demystify SwiftUI Performance and Demystify SwiftUI), views will only update when its lifetime/identity changes, which is based on explicit or structura... | https://stackoverflow.com/questions/79871613/what-causes-the-view-modifier-to-be-used-when-a-view-calls-its-body | ios, swift, swiftui | 1,768,871,315 |
se_79868658 | stackoverflow | MOBILE_DEVELOPMENT | How to check BLE GAP flags? | How to check BLE GAP flags?
Is there a way to check the device's BLE GAP flags while scanning BLE devices with CoreBluetooth?
We need to check the bytes inside so we can filter out devices in pairing (limited discoverable) mode, as their bytes are set to be different than when it is just advertising in non-pairing mod... | https://stackoverflow.com/questions/79868658/how-to-check-ble-gap-flags | ios, swift, bluetooth, bluetooth-lowenergy, core-bluetooth | 1,768,487,792 |
se_79871302 | stackoverflow | MOBILE_DEVELOPMENT | How to show screen time for iOS? | How to show screen time for iOS?
I know that we can't access the screen time report as raw data, but we can show it on screen. I'm trying to do this, but I am getting these errors:
LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={N... | https://stackoverflow.com/questions/79871302/how-to-show-screen-time-for-ios | ios, swift, flutter, screen-time | 1,768,837,486 |
se_79869285 | stackoverflow | MOBILE_DEVELOPMENT | Performing a reduce operation with Metal under Swift | Performing a reduce operation with Metal under Swift
I have a project where I would need to reduce a huge amount of data in a fast way. I thought that Metal may be the right way to do that.
I'm a C / OC / Swift developer since a long time, but totally new to Metal, so I'm (very slowly) learning it.
I found this sample... | https://stackoverflow.com/questions/79869285/performing-a-reduce-operation-with-metal-under-swift | swift, metal | 1,768,557,380 |
se_79782354 | stackoverflow | MOBILE_DEVELOPMENT | How to set project format to use Xcode version? | How to set project format to use Xcode version?
I am using Tuist version 4.81.1
Currently the generated iOS project is using Xcode 14.0.
I am wondering how to set project format to use Xcode 16.3 by Tuist method? Thank you!
Here are my files:
Tuist.swift
import ProjectDescription
let tuist = Tuist(project: .tuist())
... | https://stackoverflow.com/questions/79782354/how-to-set-project-format-to-use-xcode-version | ios, swift, tuist | 1,759,564,002 |
se_76590505 | stackoverflow | MOBILE_DEVELOPMENT | Remove background from NavigationStack in SwiftUI | Remove background from NavigationStack in SwiftUI
In my app, I want to construct a single background view under my NavigationStack and then show that same background underneath other views that I navigate to via NavigationLinks. I am trying to do this by putting the NavigationStack and my background in a ZStack, but ... | https://stackoverflow.com/questions/76590505/remove-background-from-navigationstack-in-swiftui | ios, swift, swiftui, swiftui-navigationview, swiftui-navigationstack | 1,688,140,470 |
se_79870382 | stackoverflow | MOBILE_DEVELOPMENT | How to achieve the following effect using SwiftUI? | How to achieve the following effect using SwiftUI?
I saw an app called Pieoneer on the App Store and I'm very interested in its interaction. But I don't know how to implement it.
I have already implemented the circular layout.
I haven't been able to figure out how to achieve irregular selection effects.
Can anyone... | https://stackoverflow.com/questions/79870382/how-to-achieve-the-following-effect-using-swiftui | ios, swift | 1,768,714,836 |
se_63964462 | stackoverflow | MOBILE_DEVELOPMENT | Saving and Loading MTLTexture as PNG | Saving and Loading MTLTexture as PNG
I'm trying to save and load Metal textures as PNGs, but when I load them back they appear blurrier. I think the problem is that converting a texture that's 800x600 creates a PNG that's 1600x1200, so I have to downscale the PNG to load it into an MTLTexture of the correct size.
Here... | https://stackoverflow.com/questions/63964462/saving-and-loading-mtltexture-as-png | ios, swift, metal, metalkit | 1,600,479,149 |
se_79869769 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI .task does not update its references on view update | SwiftUI .task does not update its references on view update
I have this sample code
import SwiftUI
struct ContentView: View {
var body: some View {
ParentView()
}
}
struct ParentView: View {
@State var id = 0
var body: some View {
VStack {
Button {
id+=1
... | https://stackoverflow.com/questions/79869769/swiftui-task-does-not-update-its-references-on-view-update | ios, swift, swiftui | 1,768,596,537 |
se_79769936 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 Glass Effect and toolbarColorScheme | iOS 26 Glass Effect and toolbarColorScheme
I have this navigation bar styling in my swift app:
.listStyle(.plain)
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(.visible, for: .navigationBar)
.toolbarBackground(Color(hexString: "85278d"), for: .navigationBar)
.toolbarColorScheme(.dark, for: .navigationBar)... | https://stackoverflow.com/questions/79769936/ios-26-glass-effect-and-toolbarcolorscheme | ios, swift, swiftui, ios26 | 1,758,314,349 |
se_79869863 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI Toolbar appearance not updating when bound property changes | SwiftUI Toolbar appearance not updating when bound property changes
I have a singleton Settings object defined in an iOS app, owned by the root ContentView (using the @State property wrapper). Here is ContentView (with extraneous bits removed):
struct ContentView: View {
@State private var showingSettings = false... | https://stackoverflow.com/questions/79869863/swiftui-toolbar-appearance-not-updating-when-bound-property-changes | ios, swift, swiftui | 1,768,610,576 |
se_79868990 | stackoverflow | MOBILE_DEVELOPMENT | (Initially) getting duplicate results from FetchedObjects | (Initially) getting duplicate results from FetchedObjects
I'm taking a class to try to learn iOS programming, and am working on a class project related to Core Data, filtering, and sorting. The class is doing a poor job teaching, but I'm close. I don't want anyone doing my project for me, but I think I'm stumped at de... | https://stackoverflow.com/questions/79868990/initially-getting-duplicate-results-from-fetchedobjects | ios, swift, swiftui, core-data | 1,768,518,795 |
se_40008141 | stackoverflow | MOBILE_DEVELOPMENT | NSApplicationDelegate not working without Storyboard | NSApplicationDelegate not working without Storyboard
I'm attempting to create a macOS application without a storyboard in Xcode 8 (stable) on macOS Sierra. However, my AppDelegate is not even being initiated. Here's the code I have:
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {... | https://stackoverflow.com/questions/40008141/nsapplicationdelegate-not-working-without-storyboard | swift, xcode, macos | 1,476,305,500 |
se_79868907 | stackoverflow | MOBILE_DEVELOPMENT | I don't understand Swift closures and scoping rules | I don't understand Swift closures and scoping rules
I'm trying to develop a "simple" program to remind me to get up and walk around at least once an hour. I'm linking it to the Screen Lock, because either I Lock the screen when I get up, or it Locks when I'm away for five minutes. Much of this is working, but ad... | https://stackoverflow.com/questions/79868907/i-dont-understand-swift-closures-and-scoping-rules | swift, closures, scoping | 1,768,509,300 |
se_66702430 | stackoverflow | MOBILE_DEVELOPMENT | Facebook iOS Deferred link `url` always return `nil` | Facebook iOS Deferred link `url` always return `nil`
anyone can help me??, I'm trying to use Deffered link of Facebook with the function:
AppLinkUtility.fetchDeferredAppLink { (url, error) in ... }
It doesn't matter which way I put it the code, alway the url is nil
What are the steps necessary to reproduce this is... | https://stackoverflow.com/questions/66702430/facebook-ios-deferred-link-url-always-return-nil | ios, swift, facebook, notifications, deferred-link | 1,616,127,420 |
se_75687691 | stackoverflow | MOBILE_DEVELOPMENT | Again Facebook Deferred link always return nil | Again Facebook Deferred link always return nil
After asking ATTrackingManager.requestTrackingAuthorization with an authorized status and then ask for AppLinkUtility.fetchDeferredAppLink always it return nil with this strange error:
ATTrackingManager.AuthorizationStatus must be authorized for deferred deep linking to w... | https://stackoverflow.com/questions/75687691/again-facebook-deferred-link-always-return-nil | ios, swift, deep-linking, facebook-ios-sdk, deferred-link | 1,678,380,852 |
se_44055572 | stackoverflow | MOBILE_DEVELOPMENT | IOS 10 and the deferred location update | IOS 10 and the deferred location update
several people reported the issue with the deferred location updates under IOS 10. I also struggle with this issue and did some intensive testing.
Looking at this results I can not imagine that Apples ignores such a major malfunction for more than a year (first reports I'm awar... | https://stackoverflow.com/questions/44055572/ios-10-and-the-deferred-location-update | swift, background, core-location, ios10 | 1,495,132,850 |
se_56022864 | stackoverflow | MOBILE_DEVELOPMENT | Apple "Deferred Lighting" is all green on my MacBook Pro 2018 with Vega 20 | Apple "Deferred Lighting" is all green on my MacBook Pro 2018 with Vega 20
I downloaded the example Deferred Lighting provided by Apple in its documentation. Xcode compiles it with no errors but the colors are basically all green (see Screenshot). It could be due to my graphics card but I don't know how to f... | https://stackoverflow.com/questions/56022864/apple-deferred-lighting-is-all-green-on-my-macbook-pro-2018-with-vega-20 | swift, metal | 1,557,232,850 |
se_32938960 | stackoverflow | MOBILE_DEVELOPMENT | Why is defer block executed before a closure finishes in the same function | Why is defer block executed before a closure finishes in the same function
I wrote the following function to add a map annotation that uses CLGeocoder() to resolve the location name given a coordinate. I use a defer block to get the resolved location name. However, the defer block seems to finish before the closure fi... | https://stackoverflow.com/questions/32938960/why-is-defer-block-executed-before-a-closure-finishes-in-the-same-function | ios, swift, asynchronous, clgeocoder, defer-keyword | 1,443,996,886 |
se_61818899 | stackoverflow | MOBILE_DEVELOPMENT | Swift completion in defer | Swift completion in defer
I like defer, because in complex functions with multi-case scenario, I can't forget calling completion before the function ends.
But when the completion is passed to another function, it shouldn't be run in first function's defer.
This is what I usually do:
func doSomething(completion: ()-... | https://stackoverflow.com/questions/61818899/swift-completion-in-defer | swift, completionhandler, defer-keyword | 1,589,544,647 |
se_66472712 | stackoverflow | MOBILE_DEVELOPMENT | Access properties in parent class initializer that are changed by child class | Access properties in parent class initializer that are changed by child class
In a parent class initializer I would like to use properties that have been overwritten by the child class.
See this example:
import Foundation
class Parent
{
var string = "Parent"
init()
{
print(string) // prints "Paren... | https://stackoverflow.com/questions/66472712/access-properties-in-parent-class-initializer-that-are-changed-by-child-class | swift, inheritance, init, initializer, defer-keyword | 1,614,851,970 |
se_70326502 | stackoverflow | MOBILE_DEVELOPMENT | Why did Xcode warn me about making this a constant, and why does it still change? | Why did Xcode warn me about making this a constant, and why does it still change?
Within my updateBlob function, Xcode warned me that pos is unchanged and should be changed to a let constant, even though I can see that it's being changed, and running the program does indeed change the position values. This all seemed ... | https://stackoverflow.com/questions/70326502/why-did-xcode-warn-me-about-making-this-a-constant-and-why-does-it-still-change | swift, class, constants, let, defer-keyword | 1,639,333,768 |
se_36169415 | stackoverflow | MOBILE_DEVELOPMENT | Defer block is not executed | Defer block is not executed
I have the following swift code executing in playground:
func A() {
print ("Hello")
guard 1 == 2 else {
return
}
defer {
print ("World")
}
}
A()
I expected to see
Hello
World
Instead only the Hello is printed. Why is this? What am I missing?
Here is ... | https://stackoverflow.com/questions/36169415/defer-block-is-not-executed | swift, defer-keyword | 1,458,704,488 |
se_34769694 | stackoverflow | MOBILE_DEVELOPMENT | What's the proper way of using Swift's defer | What's the proper way of using Swift's defer
Swift 2.0 introduced a new keyword: defer
What's the correct way of using this keyword, and what should I watch out for?
Since swift uses ARC, memory management is usually taken care of automagically. So defer would only need to be called for memory management for... | https://stackoverflow.com/questions/34769694/whats-the-proper-way-of-using-swifts-defer | swift, defer-keyword | 1,452,696,640 |
se_53807181 | stackoverflow | MOBILE_DEVELOPMENT | swift defer statement doesn't break point but does print | swift defer statement doesn't break point but does print
I put a defer inside a do, like so
do {
defer {
self.captureSession?.commitConfiguration()
print("commitConfiguration")
}
self.captureSession?.beginConfiguration()
// try a bunch AV session setup calls
... | https://stackoverflow.com/questions/53807181/swift-defer-statement-doesnt-break-point-but-does-print | swift, breakpoints, defer-keyword | 1,545,000,888 |
se_37710596 | stackoverflow | MOBILE_DEVELOPMENT | Swift 'defer' keyword causes Segmentation Fault | Swift 'defer' keyword causes Segmentation Fault
This is occurring on an entirely new Xcode project. The first class I added is a subclass of UIView, which works fine like this:
class CIHomeView: UIView {
init() {
super.init(frame: CGRectZero)
print("test")
}
However, as soon as I add the defer:
cla... | https://stackoverflow.com/questions/37710596/swift-defer-keyword-causes-segmentation-fault | ios, swift, defer-keyword | 1,465,411,800 |
se_42513032 | stackoverflow | MOBILE_DEVELOPMENT | What's the difference between a defer statement and a statement right just before return? | What's the difference between a defer statement and a statement right just before return?
What's the difference between this:
_ = navigationController?.popViewController(animated: true)
defer {
let rootVC = navigationController?.topViewController as? RootViewVC
rootVC?.openLink(url: url)
}
return
and t... | https://stackoverflow.com/questions/42513032/whats-the-difference-between-a-defer-statement-and-a-statement-right-just-befor | ios, swift, defer-keyword | 1,488,296,618 |
se_71020766 | stackoverflow | MOBILE_DEVELOPMENT | 'return' cannot transfer control out of a defer statement | 'return' cannot transfer control out of a defer statement
func someone() -> String {
defer {
return "World"
}
return "Hello"
}
someone()
for above snippet of code its throwing error "'return' cannot transfer control out of a defer statement" so what is the reason behind it? | https://stackoverflow.com/questions/71020766/return-cannot-transfer-control-out-of-a-defer-statement | swift, defer-keyword | 1,644,246,345 |
se_75310210 | stackoverflow | MOBILE_DEVELOPMENT | Swift defer statements internals | Swift defer statements internals
Lets assume very simple example:
func square() -> Int {
var x = 5
defer { x = 10 }
return x
}
Why 5 is returned?
We know that defer is able to work only until rbp is vanished. So defer executes until return.
That how it look like in assembly:
output.square() -> Swift.Int:
... | https://stackoverflow.com/questions/75310210/swift-defer-statements-internals | swift, defer-keyword | 1,675,254,558 |
se_76086719 | stackoverflow | MOBILE_DEVELOPMENT | "Finally" equivalent for Swift? | "Finally" equivalent for Swift?
https://nearthespeedoflight.com/browser.html
func untilThrowOrEndOfTokensReached<ConsumedType>(perform: () throws -> ConsumedType) -> [ConsumedType] {
var results = [ConsumedType]()
do {
while isNotAtEnd {
results.append(try perform())
... | https://stackoverflow.com/questions/76086719/finally-equivalent-for-swift | swift, exception, try-catch, finally, defer-keyword | 1,682,276,545 |
se_78079889 | stackoverflow | MOBILE_DEVELOPMENT | How to make SwiftData @Query updating from changes made on a background context? | How to make SwiftData @Query updating from changes made on a background context?
I have a SwiftData @Query in a LazyVStack, works nicely, updates on every model change, even if I make changes in relations only.
But I also have a long running task (~3 sec), so I created a @ModelActor for that and doing the work on a de... | https://stackoverflow.com/questions/78079889/how-to-make-swiftdata-query-updating-from-changes-made-on-a-background-context | ios, swift, swiftui, swiftdata, swift-data-modelcontext | 1,709,195,483 |
se_79562576 | stackoverflow | MOBILE_DEVELOPMENT | TabBar delay showing when using toolbar(.hidden, for: .tabBar) | TabBar delay showing when using toolbar(.hidden, for: .tabBar)
I use toolbar(.hidden, for: .tabBar) modifier to hide the tab bar in the NotificationSettingScreen. When I navigate back, SwiftUI takes a moment to re-render the tab bar, causing the delay of showing the tab bar. how to make it show instantly?
struct Notif... | https://stackoverflow.com/questions/79562576/tabbar-delay-showing-when-using-toolbar-hidden-for-tabbar | ios, swift, swiftui, mobile | 1,744,129,068 |
se_78775761 | stackoverflow | MOBILE_DEVELOPMENT | SwiftData rollback not updating the UI | SwiftData rollback not updating the UI
I'm building a simple App using SwiftData. In my app a user can create, remove and edit posts. When editing, I want them to be able to hit "Save" to persist the changes or "Cancel" to discard the changes. The approach I'm using is to disable autosave and call modelContext.save() ... | https://stackoverflow.com/questions/78775761/swiftdata-rollback-not-updating-the-ui | ios, swift, macos, swiftui, swiftdata | 1,721,579,702 |
se_79786221 | stackoverflow | MOBILE_DEVELOPMENT | Unselected UITabBar item's icon color does not change in iOS26 | Unselected UITabBar item's icon color does not change in iOS26
When trying to render a UITabBarController with custom tint color for selected and unselected items, I am getting correct behaviour on version prior to iOS26. But on iOS26 tint is correctly applied on selected items, but for unselected ones it is only ... | https://stackoverflow.com/questions/79786221/unselected-uitabbar-items-icon-color-does-not-change-in-ios26 | ios, swift, uikit, uitabbarcontroller, ios26 | 1,760,001,452 |
se_79868088 | stackoverflow | MOBILE_DEVELOPMENT | Visual Studio Code code and Xcode connection issue | Visual Studio Code code and Xcode connection issue
In Xcode my code is successfully signing and building. But when I run it from VS code this is result:
Xcode build done. 9.5s
Failed to build iOS app
Uncategorized (Xcode): Command CodeSign failed with a nonzero exit code
C... | https://stackoverflow.com/questions/79868088/visual-studio-code-code-and-xcode-connection-issue | ios, swift, flutter, xcode, visual-studio-code | 1,768,423,924 |
se_48666237 | stackoverflow | MOBILE_DEVELOPMENT | Swift Package Manager dependency in a repository subdirectory | Swift Package Manager dependency in a repository subdirectory
I have a Swift package in a subdirectory of a git repository inside GitHub. The tree looks something like this:
.
├── swift-package
│ ├── Package.swift
│ └── Sources
│ └── SomeLibrary
│ └── Library.swift
└── some-other-files
I want to a... | https://stackoverflow.com/questions/48666237/swift-package-manager-dependency-in-a-repository-subdirectory | swift, github, swift-package-manager | 1,518,013,603 |
se_35270219 | stackoverflow | MOBILE_DEVELOPMENT | How to cast Dictionary in Swift to related type? | How to cast Dictionary in Swift to related type?
This is what I am trying to do with the dictionary:
if let deliveries = dictionary["deliveries"] as? NSDictionary {
var castedDeliveries = [Double: Double]()
for delivery in deliveries {
if let value = deliv... | https://stackoverflow.com/questions/35270219/how-to-cast-dictionary-in-swift-to-related-type | ios, swift, swift-dictionary | 1,454,936,174 |
se_28012205 | stackoverflow | MOBILE_DEVELOPMENT | Map or reduce with index in Swift | Map or reduce with index in Swift
Is there a way to get the index of the array in map or reduce in Swift? I'm looking for something like each_with_index in Ruby.
func lunhCheck(number : String) -> Bool
{
var odd = true;
return reverse(number).map { String($0).toInt()! }.reduce(0) {
odd = !odd
... | https://stackoverflow.com/questions/28012205/map-or-reduce-with-index-in-swift | swift, functional-programming | 1,421,599,610 |
se_79865253 | stackoverflow | MOBILE_DEVELOPMENT | watchOS SwiftUI: UI redraws are delayed in Always-On / power-saving mode despite active timer | watchOS SwiftUI: UI redraws are delayed in Always-On / power-saving mode despite active timer
I'm working on a watchOS app using SwiftUI that updates its UI based on regular, time-driven logic. On a real Apple Watch, after the app has been running for ~1 minute, the device enters Always-On / power-saving display mode ... | https://stackoverflow.com/questions/79865253/watchos-swiftui-ui-redraws-are-delayed-in-always-on-power-saving-mode-despite | swift, swiftui, apple-watch, watchos | 1,768,087,362 |
se_79862377 | stackoverflow | MOBILE_DEVELOPMENT | How to enable Metal logging for a Swift Package? | How to enable Metal logging for a Swift Package?
I want to enable Metal shaders logging for a Swift Package as described here:
Choose your project in the Project Navigator and select the target you want to enable logging for. Click Build Settings at the top.
Search for “Other Metal Compiler Flags”.
Add -fmetal-enable... | https://stackoverflow.com/questions/79862377/how-to-enable-metal-logging-for-a-swift-package | swift, xcode, debugging, metal, swift-package | 1,767,785,850 |
se_79867681 | stackoverflow | MOBILE_DEVELOPMENT | WidgetKit Image becomes gray when widget is not primary / inactive | WidgetKit Image becomes gray when widget is not primary / inactive
I’m working with WidgetKit for the first time.
My widget works as expected, but I’m facing an issue with how it renders when it’s not the primary widget.
My widget mainly displays a large image.
When the widget is active (primary), the image is display... | https://stackoverflow.com/questions/79867681/widgetkit-image-becomes-gray-when-widget-is-not-primary-inactive | swift, swiftui, widget, widgetkit | 1,768,387,577 |
se_79866843 | stackoverflow | MOBILE_DEVELOPMENT | Flutter Live Activities not showing on Lock Screen or Dynamic Island | Flutter Live Activities not showing on Lock Screen or Dynamic Island
I’m trying to display a Live Activity + Dynamic Island in my Flutter app using the live_activities plugin.
A simple Live Activity shows correctly, but when I switched to a more detailed Live Activity layout, nothing appears on the lock screen or Dyna... | https://stackoverflow.com/questions/79866843/flutter-live-activities-not-showing-on-lock-screen-or-dynamic-island | ios, swift, flutter, widgetliveactivity | 1,768,300,091 |
se_78419226 | stackoverflow | MOBILE_DEVELOPMENT | How to create Horizontal swipe card, Right card swipe remove card and left swipe card index append in UIkit | How to create Horizontal swipe card, Right card swipe remove card and left swipe card index append in UIkit
class SwipeCardComponentVC: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var collectionView: UICollectionView!
var dataSource = ["Card 1", "Card 2", "... | https://stackoverflow.com/questions/78419226/how-to-create-horizontal-swipe-card-right-card-swipe-remove-card-and-left-swipe | ios, swift, uicollectionview, uikit, uicollectionviewlayout | 1,714,653,628 |
se_79867070 | stackoverflow | MOBILE_DEVELOPMENT | nonisolated Execution Differences Before and After Xcode 26.2 | nonisolated Execution Differences Before and After Xcode 26.2
I have an older project that was created before Xcode 26.2.
In Xcode versions prior to 26.2, there was no Swift Compiler – Concurrency build setting.
With those older versions, the following behavior occurs: a nonisolated function executes off the main thr... | https://stackoverflow.com/questions/79867070/nonisolated-execution-differences-before-and-after-xcode-26-2 | ios, swift, xcode, concurrency | 1,768,317,504 |
se_79665051 | stackoverflow | MOBILE_DEVELOPMENT | No LLMs on iOS if you don't have macOS 26 Tahoe? | No LLMs on iOS if you don't have macOS 26 Tahoe?
I'm trying to play around with the new FoundationModels API on iOS 26 and I hit a wall with the app throwing errors. It's just a simple piece of code from the tutorial example from the WWDC videos so it's pretty much a couple of lines:
func sendPrompt() async {
... | https://stackoverflow.com/questions/79665051/no-llms-on-ios-if-you-dont-have-macos-26-tahoe | ios, swift, xcode | 1,749,827,512 |
se_77062686 | stackoverflow | MOBILE_DEVELOPMENT | Enter full screen in YouTube and embed video programmatically | Enter full screen in YouTube and embed video programmatically
I've been trying to figure out a way to execute a function when the user performs a magnification gesture to enter a YouTube video into full screen. I've tried a few different approaches to enter full screen and none have worked.
Here is what I've tried:
w... | https://stackoverflow.com/questions/77062686/enter-full-screen-in-youtube-and-embed-video-programmatically | html, ios, swift, swiftui, youtube | 1,694,118,660 |
se_77125593 | stackoverflow | MOBILE_DEVELOPMENT | Why are the child elements inheriting the parent accessibility identifier? | Why are the child elements inheriting the parent accessibility identifier?
I have this view (and accessibility identifier):
private var carStack: some View {
CarSwiftUIView(viewModel: viewModel.carViewModel)
.accessibilityIdentifier("car")
.accessibilityElement(children: .ignore)
}
If I use .ignor... | https://stackoverflow.com/questions/77125593/why-are-the-child-elements-inheriting-the-parent-accessibility-identifier | swift, xcuitest, xcuielement | 1,695,025,869 |
se_58676483 | stackoverflow | MOBILE_DEVELOPMENT | Is there a way to call a function when a SwiftUI Picker selection changes? | Is there a way to call a function when a SwiftUI Picker selection changes?
I would like to call a function when selectedOption's value changes. Is there a way to do this in SwiftUI similar to when editing a TextField?
Specifically, I would like to save the selected option when the user changes the selectedOption.
He... | https://stackoverflow.com/questions/58676483/is-there-a-way-to-call-a-function-when-a-swiftui-picker-selection-changes | swift, onchange, swiftui, picker | 1,572,741,218 |
se_49903745 | stackoverflow | MOBILE_DEVELOPMENT | How can you do a simple inline test for an enumeration's case that has associated values you don't care about? | How can you do a simple inline test for an enumeration's case that has associated values you don't care about?
Given this code:
class Item{}
func foo(item:Item){}
enum SelectionType{
case single(resultsHandler:(Item)->Void)
case multi(resultsHandler:([Item])->Void)
}
var selectionType:SelectionType... | https://stackoverflow.com/questions/49903745/how-can-you-do-a-simple-inline-test-for-an-enumerations-case-that-has-associate | swift, enums, swift4, associated-value | 1,524,065,843 |
se_44995244 | stackoverflow | MOBILE_DEVELOPMENT | Embed multiple view controllers in a container view | Embed multiple view controllers in a container view
I have a base view controller which is like my "blueprint" to create more view controllers to show the user (register/login/reset password/etc.). This base view controller has a container view.
I have many little view controllers that I would like for the container... | https://stackoverflow.com/questions/44995244/embed-multiple-view-controllers-in-a-container-view | ios, swift, storyboard | 1,499,594,816 |
se_79864254 | stackoverflow | MOBILE_DEVELOPMENT | TimelineView or timer in .common RunLoop mode causing Menu with .buttonStyle(.plain) to flicker | TimelineView or timer in .common RunLoop mode causing Menu with .buttonStyle(.plain) to flicker
A TimelineView or a timer with .common RunLoop mode causes a Menu's submenu in the same view hierarchy, even if not a parent of the menu, to flicker.
However, this only happens if the Menu has a .buttonStyle(.plain) modifie... | https://stackoverflow.com/questions/79864254/timelineview-or-timer-in-common-runloop-mode-causing-menu-with-buttonstyle-pl | swift, macos, swiftui | 1,767,959,386 |
se_48389003 | stackoverflow | MOBILE_DEVELOPMENT | How do I detect the Apple Watch screenshot event/digital crown + side button press? | How do I detect the Apple Watch screenshot event/digital crown + side button press?
The native workout app and Sportstracker for example have the ability to pause the workout when a user presses both the digital crown and the side button at the same time, AKA taking a screenshot.
I need something like this but I can'... | https://stackoverflow.com/questions/48389003/how-do-i-detect-the-apple-watch-screenshot-event-digital-crown-side-button-pre | ios, swift, screenshot, watchkit | 1,516,649,667 |
se_79865970 | stackoverflow | MOBILE_DEVELOPMENT | Authenticating ILMessageFilterExtension network requests using SecAddSharedWebCredential and messagefilter service | Authenticating ILMessageFilterExtension network requests using SecAddSharedWebCredential and messagefilter service
I am implementing a custom SMS filter using the IdentityLookup framework. My goal is to authenticate the network requests made via context.deferQueryRequestToNetwork using a user-specific JWT token genera... | https://stackoverflow.com/questions/79865970/authenticating-ilmessagefilterextension-network-requests-using-secaddsharedwebcr | ios, swift, iphone, ios26 | 1,768,208,115 |
se_79865762 | stackoverflow | MOBILE_DEVELOPMENT | iOS Safari Web Extension: Communication with Apple Watch App fails | iOS Safari Web Extension: Communication with Apple Watch App fails
I am building an iOS app that includes a Safari Web Extension and a companion Apple Watch App.
My goal is simple: When the user taps the button in the Safari Extension popup, I want to send a message (e.g., the current timestamp) to the Apple Watch.
Th... | https://stackoverflow.com/questions/79865762/ios-safari-web-extension-communication-with-apple-watch-app-fails | ios, swift, safari-extension, watchconnectivity, wcsession | 1,768,168,987 |
se_72788019 | stackoverflow | MOBILE_DEVELOPMENT | Where is Swift Package Manager cache located (Swift 5.7)? | Where is Swift Package Manager cache located (Swift 5.7)?
After retagging a git commit I'm no longer able to fetch the package, because SP Manager uses some cache which I can't find and clean. Getting error:
Revision 30c16cab9c718416fee2191ff2ac0b6f91eeb511 for base
remoteSourceControl https://github.com/myUser/myRep... | https://stackoverflow.com/questions/72788019/where-is-swift-package-manager-cache-located-swift-5-7 | ios, swift, macos, swift5, swift-package-manager | 1,656,425,462 |
se_79856792 | stackoverflow | MOBILE_DEVELOPMENT | Modifying input audio | Modifying input audio
Is there a way to make audio sound robotic or put some other effects? For example, I have the code, that reverses the audio. But i manually modify it. Is there any library available?
The reverse effect:
func reverseAudio(at url: URL) async throws -> URL {
let file = try AVAudioFile(forRea... | https://stackoverflow.com/questions/79856792/modifying-input-audio | swift, avfoundation | 1,767,012,804 |
se_28766326 | stackoverflow | MOBILE_DEVELOPMENT | Swift - [NSObject : AnyObject]!' is not a subtype of 'Dictionary<String, AnyObject> | Swift - [NSObject : AnyObject]!' is not a subtype of 'Dictionary<String, AnyObject>
I got this error message
[NSObject : AnyObject]!' is not a subtype of 'Dictionary<String, AnyObject>
This is my code:
self.client.getAccessToken(code, success: { (accessTokenData:Dictionary<String, AnyObject>) -> Void i... | https://stackoverflow.com/questions/28766326/swift-nsobject-anyobject-is-not-a-subtype-of-dictionarystring-anyobje | ios, swift | 1,425,043,924 |
se_79865643 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI text fade transition not animating in iOS 16+ - how to animate text content changes? (2026) | SwiftUI text fade transition not animating in iOS 16+ - how to animate text content changes? (2026)
I'm trying to animate a text value change with a smooth fade transition in SwiftUI (iOS 16+). I've seen older answers suggesting .transition(.opacity) with .id() modifier, but I'm looking for the modern approach that wo... | https://stackoverflow.com/questions/79865643/swiftui-text-fade-transition-not-animating-in-ios-16-how-to-animate-text-cont | ios, swift, animation, swiftui, ios26 | 1,768,153,033 |
se_79785214 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26: hidesSharedBackground works for leftBarButtonItem but not for backBarButtonItem | iOS 26: hidesSharedBackground works for leftBarButtonItem but not for backBarButtonItem
In iOS 26, Apple introduced a new shadow/background effect around navigation bar buttons. The hidesSharedBackground property successfully removes this effect from regular bar button items, but fails to work when applied to a backBa... | https://stackoverflow.com/questions/79785214/ios-26-hidessharedbackground-works-for-leftbarbuttonitem-but-not-for-backbarbut | ios, swift, uikit, uinavigationbar, ios26 | 1,759,911,004 |
se_64637960 | stackoverflow | MOBILE_DEVELOPMENT | Extension for Array where Element is Optional | Extension for Array where Element is Optional
I have an array of String? like so
var myArray: [String?] = ["2", "banana", nil, "31"];
I have another array of String like so:
var myStringArray: [String] = ["2", "3"]
I wrote an extension for Array to return me an Optional if index is not valid (which avoids the whole ... | https://stackoverflow.com/questions/64637960/extension-for-array-where-element-is-optional | swift | 1,604,272,491 |
se_73502782 | stackoverflow | MOBILE_DEVELOPMENT | Multiple function calls, but single execution of async Task | Multiple function calls, but single execution of async Task
I am playing around with Apple's new WeatherKit + WidgetKit. Unfortunately I can't seem to find a solution for the combination of the following three problems:
WidgetKit requires to load all data in the getTimeline function (no dynamic updating of the UI)
Wi... | https://stackoverflow.com/questions/73502782/multiple-function-calls-but-single-execution-of-async-task | swift, swiftui, widgetkit, weatherkit | 1,661,524,962 |
se_76133232 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI horizontal wheel picker cell item size | SwiftUI horizontal wheel picker cell item size
I'm currently trying to achieve a horizontal picker view where the user can select its avatar shirt. The rotation and adjustments of the picker works fine but my selected picker view cell size does not resize to the actual image size of my items array. This leads to overl... | https://stackoverflow.com/questions/76133232/swiftui-horizontal-wheel-picker-cell-item-size | ios, swift, swiftui, swiftui-picker | 1,682,715,359 |
se_79862076 | stackoverflow | MOBILE_DEVELOPMENT | How to build a non-sticky toolbar background with sticky title in SwiftUI | How to build a non-sticky toolbar background with sticky title in SwiftUI
I've taken a liking to a few particular apps that have a color/background behind their toolbar at the top of the view, as if to emphasize the navigation titles/headers, but then you can scroll past it.
I'm targeting iOS 26. This is what I have s... | https://stackoverflow.com/questions/79862076/how-to-build-a-non-sticky-toolbar-background-with-sticky-title-in-swiftui | ios, swift, swiftui, swiftui-scrollview, swiftui-toolbar | 1,767,758,841 |
se_79860389 | stackoverflow | MOBILE_DEVELOPMENT | VoiceOver focus does not reset to top when navigating between screens in SwiftUI | VoiceOver focus does not reset to top when navigating between screens in SwiftUI
I’m developing an iOS application using SwiftUI and I’m having persistent issues with VoiceOver accessibility focus when navigating between screens.
When navigating from one screen to another, VoiceOver focus does not reset to the top of ... | https://stackoverflow.com/questions/79860389/voiceover-focus-does-not-reset-to-top-when-navigating-between-screens-in-swiftui | ios, swift, swiftui, accessibility, voiceover | 1,767,561,726 |
se_79864486 | stackoverflow | MOBILE_DEVELOPMENT | Remove entity from NSPersistentCloudKitContainer | Remove entity from NSPersistentCloudKitContainer
I'm using NSPersistentCloudKitContainer and I have added an entity (to the private database) to the core data model. Now I have realised that I don't need that entity anymore and I want to get rid of it from my code.
But it doesn't seem to be as simple as deleting it fr... | https://stackoverflow.com/questions/79864486/remove-entity-from-nspersistentcloudkitcontainer | ios, swift, core-data, cloudkit, nspersistentcloudkitcontainer | 1,767,975,799 |
se_71173527 | stackoverflow | MOBILE_DEVELOPMENT | macOS app local notification doesn't show app icon? | macOS app local notification doesn't show app icon?
I've already added AppIcon.appiconset Icon Files in info.plist, also no xcassets warnings. If I understand correctly, the app should show AppIcon if I set IconFiles in info.plist and AppIcons in General right? | https://stackoverflow.com/questions/71173527/macos-app-local-notification-doesnt-show-app-icon | swift, xcode, macos, cocoa | 1,645,187,449 |
se_74478409 | stackoverflow | MOBILE_DEVELOPMENT | Missing defaults dictionary to restore state for: PKPaletteNamedDefaults | Missing defaults dictionary to restore state for: PKPaletteNamedDefaults
[ToolPicker] Missing defaults dictionary to restore state for: PKPaletteNamedDefaults
warning is outputted on my screen.
I am looking to resolve this error and have found that if I don't make the following call, I do not get an error. What am I... | https://stackoverflow.com/questions/74478409/missing-defaults-dictionary-to-restore-state-for-pkpalettenameddefaults | swift, pencilkit | 1,668,700,389 |
se_76123702 | stackoverflow | MOBILE_DEVELOPMENT | .preferredColorScheme(nil) visual bug when switching to system light / dark more | .preferredColorScheme(nil) visual bug when switching to system light / dark more
I have a simple settings view for my MacOS app with a segmented picker for setting the light/dark/automatic(system) mode. It works just fine when switching between the dark and light modes, but when I set it to system (.preferredColorSche... | https://stackoverflow.com/questions/76123702/preferredcolorschemenil-visual-bug-when-switching-to-system-light-dark-more | swift, macos, swiftui | 1,682,621,024 |
se_78655586 | stackoverflow | MOBILE_DEVELOPMENT | Xcode 16 Swift Testing: default value for `SourceLocation` when calling helper function | Xcode 16 Swift Testing: default value for `SourceLocation` when calling helper function
I have a helper function that looks something like this:
private func test(state: State, against expectedState: State, sourceLocation: SourceLocation) {
// a bunch of irrelevant checks happening here
#expect(something == so... | https://stackoverflow.com/questions/78655586/xcode-16-swift-testing-default-value-for-sourcelocation-when-calling-helper-f | swift, xcode16, swift-testing | 1,719,047,296 |
se_79863879 | stackoverflow | MOBILE_DEVELOPMENT | iOS26 SwiftUI DatePicker giving unreliable/inconsistent date formatting | iOS26 SwiftUI DatePicker giving unreliable/inconsistent date formatting
I have a ForEach inside of a List where I display an airport TextField and an arrival time as a .compact DatePicker inside of a HStack. When iOS18 was around, this worked perfectly consistently and displayed date in dd MMM yyyy format. With iOS26 ... | https://stackoverflow.com/questions/79863879/ios26-swiftui-datepicker-giving-unreliable-inconsistent-date-formatting | ios, swift, date, swiftui, datepicker | 1,767,926,142 |
se_70753723 | stackoverflow | MOBILE_DEVELOPMENT | Hide a button in SwiftUI to use its keyboardShortcut on MacOS | Hide a button in SwiftUI to use its keyboardShortcut on MacOS
I have Buttons with a keyboardShortcut in my view to receive keyboardShortcuts, but I don't want the Buttons to be visible.
Ho do I hide them best?
I tried like this, but if I add .buttonStyle(PlainButtonStyle()) to the group, the buttons with the arrows do... | https://stackoverflow.com/questions/70753723/hide-a-button-in-swiftui-to-use-its-keyboardshortcut-on-macos | swift, macos, swiftui | 1,642,500,445 |
se_79814381 | stackoverflow | MOBILE_DEVELOPMENT | Squeezed width and height of NSButton Appkit | Squeezed width and height of NSButton Appkit
I am trying to create buttons for my player, however, I am getting a squeezed buttons even though I assigned even width and height in appkit NSButtons.
This is the final result I am getting:
private func setupControls() {
undoButton = createButton(imageName: "arrow.utu... | https://stackoverflow.com/questions/79814381/squeezed-width-and-height-of-nsbutton-appkit | swift, macos, appkit, nsbutton, nsstackview | 1,762,627,190 |
se_77503917 | stackoverflow | MOBILE_DEVELOPMENT | is it possible to limit parallel tests in xcuitest? | is it possible to limit parallel tests in xcuitest?
Im doing uitest, in test plan theres 'execute in parallel (if possible)' option. However this launches 5 simulator in my case, consuming all 32gb of ram (and some swap) and tests fails for unknown reasons, is it possible to limit maximum number of launched simulator ... | https://stackoverflow.com/questions/77503917/is-it-possible-to-limit-parallel-tests-in-xcuitest | swift, xcode, xctest, xcuitest | 1,700,245,957 |
se_79863696 | stackoverflow | MOBILE_DEVELOPMENT | Motion not available ios 26 live photo | Motion not available ios 26 live photo
I’m trying to set a Live Photo as a live wallpaper on iOS. I’ve saved the Live Photo to my Photos library, but when I attempt to set it as the wallpaper, the Live Photo effect option is grayed out.
I try all scenarios for correct video; 3second 1 second
I downloaded a video from ... | https://stackoverflow.com/questions/79863696/motion-not-available-ios-26-live-photo | ios, swift, react-native | 1,767,901,440 |
se_32427227 | stackoverflow | MOBILE_DEVELOPMENT | App is crashing because of a zombie when switching tabs | App is crashing because of a zombie when switching tabs
I have an app with a TabBarNavigationController and a NavigationController.
The views of the navigation Controller are"
HomeViewController
CharacterViewController
FinalViewController
I have a function in CharacterViewController and FinalViewController so that i... | https://stackoverflow.com/questions/32427227/app-is-crashing-because-of-a-zombie-when-switching-tabs | ios, swift, nszombie | 1,441,566,525 |
se_57610979 | stackoverflow | MOBILE_DEVELOPMENT | Looping AVPlayer with custom Start/End Times | Looping AVPlayer with custom Start/End Times
I am using an AVPlayer to play video. I would like to be able to loop sections of the video based on the user's input (while the video is playing, the user can press a button to start a loop and then press it once more to end after a few seconds pass -- then it should begin... | https://stackoverflow.com/questions/57610979/looping-avplayer-with-custom-start-end-times | swift, avfoundation, avplayer, cmtime | 1,566,482,002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.