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_79851066 | stackoverflow | MOBILE_DEVELOPMENT | Complete SWIFT_STRICT_CONCURRENCY does not show errors for non thread-safe code | Complete SWIFT_STRICT_CONCURRENCY does not show errors for non thread-safe code
I have a project where I want to see Swift 6 warnings. This is my setup.
Using Swift 6:
> git grep "SWIFT_VERSION"
xx.xcodeproj/project.pbxproj: SWIFT_VERSION = 6.0;
xx.xcodeproj/project.pbxproj: ... | https://stackoverflow.com/questions/79851066/complete-swift-strict-concurrency-does-not-show-errors-for-non-thread-safe-code | swift, swift6, xcode26, sendable | 1,766,144,622 |
se_27338573 | stackoverflow | MOBILE_DEVELOPMENT | Rounding a double value to x number of decimal places in swift | Rounding a double value to x number of decimal places in swift
Can anyone tell me how to round a double value to x number of decimal places in Swift?
I have:
var totalWorkTimeInHours = (totalWorkTime/60/60)
With totalWorkTime being an NSTimeInterval (double) in second.
totalWorkTimeInHours will give me the hours... | https://stackoverflow.com/questions/27338573/rounding-a-double-value-to-x-number-of-decimal-places-in-swift | swift, double, nstimeinterval | 1,417,915,641 |
se_67045482 | stackoverflow | MOBILE_DEVELOPMENT | UITextView Representable in SwiftUI not respecting bounds for width in ScrollView | UITextView Representable in SwiftUI not respecting bounds for width in ScrollView
I want to present text in a UITextView using SwiftUI. I'm using UIViewRepresentable and having issues with the width when it exceeds the bounds of the scrollView. I would like if to wrap the text but instead it just continues on one lo... | https://stackoverflow.com/questions/67045482/uitextview-representable-in-swiftui-not-respecting-bounds-for-width-in-scrollvie | swift, xcode, swiftui, uitextview | 1,618,147,307 |
se_76781545 | stackoverflow | MOBILE_DEVELOPMENT | Swift Async awaiting all tasks in task group | Swift Async awaiting all tasks in task group
I am using a task group to wrap repeated calls to a long running async method. Since I may have many calls to this method that need to happen the hope is that they would run in parallel. At the end of the day I have some regular synchronous code that needs to block until al... | https://stackoverflow.com/questions/76781545/swift-async-awaiting-all-tasks-in-task-group | ios, swift, async-await | 1,690,473,603 |
se_32670714 | stackoverflow | MOBILE_DEVELOPMENT | Swift Automatic Push Notification with Geolocation | Swift Automatic Push Notification with Geolocation
I need to integrate push notifications in my app. I saw a lot of tutorials, but none helped me because I need to do something more difficult. In fact I need the system to send a push notification to all users automatic when a news item is published in the database. ex... | https://stackoverflow.com/questions/32670714/swift-automatic-push-notification-with-geolocation | php, ios, swift, push-notification | 1,442,681,096 |
se_59639048 | stackoverflow | MOBILE_DEVELOPMENT | How can I make a simple circular button in SwiftUI in macOS? | How can I make a simple circular button in SwiftUI in macOS?
Seems like it should be simple.
Button(action: {
}){
ZStack {
Circle()
.frame(width: 100, height: 100)
.foregroundColor(.blue)
Text("Press me")
}
}
This gives me:
I can only click on the rectangle part.
Also ... | https://stackoverflow.com/questions/59639048/how-can-i-make-a-simple-circular-button-in-swiftui-in-macos | swift, macos, swiftui | 1,578,454,298 |
se_66685561 | stackoverflow | MOBILE_DEVELOPMENT | How to make mesh gradient in UiKit | How to make mesh gradient in UiKit
I’d like to make mesh gradient for views background like this
How can I do it with UIKit? Maybe there is proprieties in CAGradientLayer | https://stackoverflow.com/questions/66685561/how-to-make-mesh-gradient-in-uikit | ios, swift, uikit, gradient | 1,616,047,359 |
se_58588891 | stackoverflow | MOBILE_DEVELOPMENT | How to change theme style (User Interface Style) immediately in Swift in iOS 13 | How to change theme style (User Interface Style) immediately in Swift in iOS 13
I'm using Swift 5.1 and Xcode 11.1 and I've currently finished implementing Dark Mode design.
App has setting where user can set display theme(Light, Dark, System Default) and currently it's working fine if app restarts after user selects... | https://stackoverflow.com/questions/58588891/how-to-change-theme-style-user-interface-style-immediately-in-swift-in-ios-13 | ios, swift, ios-darkmode | 1,572,256,839 |
se_79822141 | stackoverflow | MOBILE_DEVELOPMENT | How to dynamically size TextEditor like TextField in SwiftUI | How to dynamically size TextEditor like TextField in SwiftUI
In SwiftUI, you can dynamically size a TextField like this which expands vertically as the user types.
TextField("Enter text", text: $text, axis: .vertical)
I would like to do the same thing using a TextEditor, especially now that it supports AttributedStrin... | https://stackoverflow.com/questions/79822141/how-to-dynamically-size-texteditor-like-textfield-in-swiftui | swift, swiftui, swiftui-texteditor | 1,763,373,792 |
se_79850209 | stackoverflow | MOBILE_DEVELOPMENT | Swift keyboard extension opens a URL when Full Access is not allowed on iOS 26.0 and later | Swift keyboard extension opens a URL when Full Access is not allowed on iOS 26.0 and later
I created a button in my keyboard extension to open my app. Previously, the app could be opened even when the user had not enabled Full Access for the keyboard. However, starting from iOS 26, this no longer works—the keyboard mu... | https://stackoverflow.com/questions/79850209/swift-keyboard-extension-opens-a-url-when-full-access-is-not-allowed-on-ios-26-0 | ios, swift, keyboard, ios-keyboard-extension, ios26 | 1,766,054,208 |
se_79850823 | stackoverflow | MOBILE_DEVELOPMENT | Weird crash with keyboardLayoutGuide in ios 26 | Weird crash with keyboardLayoutGuide in ios 26
I have this feature which was working just fine until one day, it crashes when I push another VC or pop to previous VC. the crash log says:
Assertion failure in void _engineVar_rawRemove(NSISEngineVar)(), NSISEngine_EngineVar.h:181 Not possible to remove variable: 1020: <... | https://stackoverflow.com/questions/79850823/weird-crash-with-keyboardlayoutguide-in-ios-26 | ios, swift, nslayoutconstraint, ios26 | 1,766,117,480 |
se_79849768 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI Sheet with multiple detents and a text field in the safe area inset bug | SwiftUI Sheet with multiple detents and a text field in the safe area inset bug
I have a very simple proof of concept:
struct ContentView: View {
@State private var selectedDetent: PresentationDetent = .medium
var body: some View {
VStack {
Image(systemName: "globe")
.i... | https://stackoverflow.com/questions/79849768/swiftui-sheet-with-multiple-detents-and-a-text-field-in-the-safe-area-inset-bug | ios, swift, swiftui, swiftui-sheet | 1,766,000,013 |
se_79850451 | stackoverflow | MOBILE_DEVELOPMENT | SwiftData iOS 26: Model inheritance breaks when another model has relationships to the parent class | SwiftData iOS 26: Model inheritance breaks when another model has relationships to the parent class
I'm testing SwiftData model inheritance (new in iOS 26) and encountering a crash when combining:
A model that inherits from another model
A separate model with relationships to the parent class
Minimal Reproducible Ex... | https://stackoverflow.com/questions/79850451/swiftdata-ios-26-model-inheritance-breaks-when-another-model-has-relationships | swift, inheritance, core-data, swiftdata, swift6 | 1,766,071,117 |
se_79850140 | stackoverflow | MOBILE_DEVELOPMENT | How do you pass a view model from a parent view to a child view? | How do you pass a view model from a parent view to a child view?
As a learning exercise I am experimenting with using protocols in combination with MVVM. Most of the views in my learning app have a single view model that uses a protocol, that way I can create a mock for previews and testing.
The view looks like this:
... | https://stackoverflow.com/questions/79850140/how-do-you-pass-a-view-model-from-a-parent-view-to-a-child-view | ios, swift, swiftui | 1,766,048,168 |
se_79850431 | stackoverflow | MOBILE_DEVELOPMENT | In Family controls in swiftui when user selects a category is it possible to show individual apps from that category instead of showing category name | In Family controls in swiftui when user selects a category is it possible to show individual apps from that category instead of showing category name
When we work with family controls api in swiftui and we select a category in family activity selection, we can show that category using label in the ui but is it possibl... | https://stackoverflow.com/questions/79850431/in-family-controls-in-swiftui-when-user-selects-a-category-is-it-possible-to-sho | ios, swift, swiftui, parental-control | 1,766,069,395 |
se_79849411 | stackoverflow | MOBILE_DEVELOPMENT | How to show native iOS confirmation popup attached to button (like Apple Reminders app)? | How to show native iOS confirmation popup attached to button (like Apple Reminders app)?
I'm trying to replicate the native iOS confirmation popup that appears attached to a button like in Apple's Reminders app when you tap the X button to discard changes.
What I want (Apple Reminders behavior):
The confirmation pop... | https://stackoverflow.com/questions/79849411/how-to-show-native-ios-confirmation-popup-attached-to-button-like-apple-reminde | swift, swiftui, swiftui-navigationstack, swiftui-alert | 1,765,972,972 |
se_68834102 | stackoverflow | MOBILE_DEVELOPMENT | Testing the transition from app clip to full app | Testing the transition from app clip to full app
My app has been in the app store for a while now. I now want to add an app clip which has a button that sends the users to download the full app from the app store (Using SKOverlay). In addition, I want the app clip to pass parameters to the full app (this step is cruci... | https://stackoverflow.com/questions/68834102/testing-the-transition-from-app-clip-to-full-app | ios, swift, xcode, app-store-connect, apple-appclips | 1,629,296,095 |
se_26713582 | stackoverflow | MOBILE_DEVELOPMENT | didSelectAnnotationView not called | didSelectAnnotationView not called
I would like to work with an annotation once it's clicked. I've looked it up on the documentation of Apple and I did googled but I can not find why this is any different than how it should be done.
Basically; I don't get a println("Pin clicked");
Why not?
func mapView(mapView: ... | https://stackoverflow.com/questions/26713582/didselectannotationview-not-called | ios, swift, mkannotationview | 1,415,015,053 |
se_79839165 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI (sheets) - presentationDetents behaves incorrectly on iOS 16–18 but works correctly on iOS 26 | SwiftUI (sheets) - presentationDetents behaves incorrectly on iOS 16–18 but works correctly on iOS 26
I'm using a custom modifier called AutoSheetDetentModifier to automatically size a sheet based on its content.
On iOS 26, it works as expected: the content height is measured and the sheet shrinks to match that height... | https://stackoverflow.com/questions/79839165/swiftui-sheets-presentationdetents-behaves-incorrectly-on-ios-16-18-but-work | ios, swift, iphone, swiftui, swiftui-sheet | 1,764,955,986 |
se_79849425 | stackoverflow | MOBILE_DEVELOPMENT | SwiftLint is ignoring excluded files in config when paths are passed to the command | SwiftLint is ignoring excluded files in config when paths are passed to the command
I have some excluded files in my .swiftlint.yml file but when I pass in a list of files† to the swiftlint command (e.g. swiftlint lint <paths maybe including excluded files>), all the files get linted, even the ones in my config exclud... | https://stackoverflow.com/questions/79849425/swiftlint-is-ignoring-excluded-files-in-config-when-paths-are-passed-to-the-comm | swift, swiftlint | 1,765,973,622 |
se_79847565 | stackoverflow | MOBILE_DEVELOPMENT | Xcode : Embed different .xcframework based on scheme (dev/uat/prod) without breaking Embed & Sign | Xcode : Embed different .xcframework based on scheme (dev/uat/prod) without breaking Embed & Sign
I have a Flutter iOS app with multiple schemes/flavors:
dev
uat
prod
Each scheme maps to a different build configuration (e.g. Debug-dev, Debug-uat, Release-prod, etc.).
I need to embed a third-party SDK that is ... | https://stackoverflow.com/questions/79847565/xcode-embed-different-xcframework-based-on-scheme-dev-uat-prod-without-brea | ios, swift, xcode, mobile | 1,765,792,941 |
se_60995278 | stackoverflow | MOBILE_DEVELOPMENT | Custom Button in SwiftUI List | Custom Button in SwiftUI List
SwiftUI Custom Button in List
I'm trying to create a custom button in a SwiftUI List. I want it to have a blue background with white text, and importantly, to remain blue and go to 50% opacity when pressed, not the default grey.
I tried using a custom ButtonStyle, but when I do so, the ... | https://stackoverflow.com/questions/60995278/custom-button-in-swiftui-list | swift, list, button, swiftui | 1,585,841,556 |
se_76742340 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI .popover frame size incorrect | SwiftUI .popover frame size incorrect
In iOS 16.4 we can now use .presentationCompactAdaptation(.none) in our .popover to achieve a true popover on iOS (compact screen sizes).
SomeView()
.popover(isPresented: $isPopoverOpen) {
Text("Hello world!")
.fixedSize(horizontal: false, vertical: true)
... | https://stackoverflow.com/questions/76742340/swiftui-popover-frame-size-incorrect | ios, swift, swiftui, popover, swiftui-sheet | 1,690,001,226 |
se_79847724 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI turns a String into <uninitialized> when called asynchronously | SwiftUI turns a String into <uninitialized> when called asynchronously
The Context
We have a ChildView that depends on an environment value:
struct Child: View {
@Environment(\.printer) var printer
var body: some View {
Button("Print it") {
Task {
await printer.print(... | https://stackoverflow.com/questions/79847724/swiftui-turns-a-string-into-uninitialized-when-called-asynchronously | swift, swiftui, async-await, concurrency, swiftui-environment | 1,765,806,212 |
se_38007286 | stackoverflow | MOBILE_DEVELOPMENT | How to simulate visits on iOS? | How to simulate visits on iOS?
how do we simulate a realistic path where you go to a particular location, stop for a while then move on. We are trying to trigger the visit monitoring API. preferably using the iPhone simulator | https://stackoverflow.com/questions/38007286/how-to-simulate-visits-on-ios | ios, swift, xcode7, core-location | 1,466,751,173 |
se_66488558 | stackoverflow | MOBILE_DEVELOPMENT | Insecure APIs (_memcpy) can still be found in the iOS Application | Insecure APIs (_memcpy) can still be found in the iOS Application
We have developed an IOS application and found that the application binary file is using _malloc() function somewhere inside.
otool MyAppName -Iv | grep _malloc
0x00000001008dd812 155991 _malloc
0x000000010092d9b0 155991 _malloc
otool MyAppName -Iv | g... | https://stackoverflow.com/questions/66488558/insecure-apis-memcpy-can-still-be-found-in-the-ios-application | swift, memcpy, otool | 1,614,930,022 |
se_78874033 | stackoverflow | MOBILE_DEVELOPMENT | How to Hide Internal Dependencies in Swift Framework's .swiftinterface File? | How to Hide Internal Dependencies in Swift Framework's .swiftinterface File?
I’m building a Swift framework that uses internal dependencies like Alamofire, Lottie, and TensorFlowLite. These are only needed within the framework itself, not by the users of the framework.
But when I build the framework, these depende... | https://stackoverflow.com/questions/78874033/how-to-hide-internal-dependencies-in-swift-frameworks-swiftinterface-file | ios, swift, swiftui, tensorflow-lite, xcframework | 1,723,706,555 |
se_78513178 | stackoverflow | MOBILE_DEVELOPMENT | Store a reference to a TaskGroup or add to it outside of scope | Store a reference to a TaskGroup or add to it outside of scope
I'm trying to replace DispatchGroup with a TaskGroup because I can cancel a TaskGroup... however I can't store a reference to a TaskGroup..
The methods withTaskGroup(...) and withDiscardingTaskGroup(...) seem to be built around the assumption that you'll a... | https://stackoverflow.com/questions/78513178/store-a-reference-to-a-taskgroup-or-add-to-it-outside-of-scope | swift, swift5, swift-concurrency, swift-task | 1,716,308,745 |
se_32719307 | stackoverflow | MOBILE_DEVELOPMENT | Refresh frequency using socket - iOS swift | Refresh frequency using socket - iOS swift
I'm new to iOS dev, it's only my second application, but I didn't make it this time. So, I need suggestion and tips to see how things really work.
I'm trying to develop an app which uses sharedMemory data of a game and sends it over sockets to an iPhone.
I proceed this way:
... | https://stackoverflow.com/questions/32719307/refresh-frequency-using-socket-ios-swift | c++, ios, iphone, swift, sockets | 1,442,931,288 |
se_79847502 | stackoverflow | MOBILE_DEVELOPMENT | Rounded corner of a cut-out arc using UIBezierPath without off-setting the arc centre | Rounded corner of a cut-out arc using UIBezierPath without off-setting the arc centre
(This question is a sequel to this one—I'm trying to figure out how to adapt the code to new circumstances.)
I have a code that produces this shape:
The code is extracted into a function, producing CGPath:
private func makePath(
w... | https://stackoverflow.com/questions/79847502/rounded-corner-of-a-cut-out-arc-using-uibezierpath-without-off-setting-the-arc-c | ios, swift, uikit, core-animation, uibezierpath | 1,765,787,159 |
se_79821647 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 prominent button with glass effect results in button image barely visible | iOS 26 prominent button with glass effect results in button image barely visible
I have an iOS 26 app in which I have defined the app wide tintColor to be green:
UIView.appearance().tintColor = UIColor.systemGreen
I have a done button in my navigation bar whose style is .prominent:
let style: UIBarButtonItem.Style = ... | https://stackoverflow.com/questions/79821647/ios-26-prominent-button-with-glass-effect-results-in-button-image-barely-visible | ios, swift, uibutton, ios26, uibarbuttonitemstyle | 1,763,315,940 |
se_79847594 | stackoverflow | MOBILE_DEVELOPMENT | Using Combine for the first time. XCTTest completes before combine promise is fulfilled | Using Combine for the first time. XCTTest completes before combine promise is fulfilled
func getCharactersList(from url: URL) -> AnyPublisher<[Character], NetworkRequestError> {
if shouldReturnError {
// Fail with concrete NetworkRequestError
return Fail(error: error)
.eraseToAnyPublish... | https://stackoverflow.com/questions/79847594/using-combine-for-the-first-time-xcttest-completes-before-combine-promise-is-fu | swift, unit-testing, testing, swiftui, combine | 1,765,795,998 |
se_79847238 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 UIButton liquid glass tint flickers during interactive dismiss of zoom transition | iOS 26 UIButton liquid glass tint flickers during interactive dismiss of zoom transition
I'm experiencing an issue with a UIButton using UIButton.Configuration.prominentGlass() on iOS 26. When I present a modal using iOS 18's .zoom transition and then interactively dismiss it (swipe down), the button's tint color brie... | https://stackoverflow.com/questions/79847238/ios-26-uibutton-liquid-glass-tint-flickers-during-interactive-dismiss-of-zoom-tr | swift, uibutton, ios26, liquid-glass | 1,765,745,324 |
se_79847470 | stackoverflow | MOBILE_DEVELOPMENT | UIToolbar buttons losing spacing in Xcode 26.1.1 Legacy Mode (UIDesignRequiresCompatibility) | UIToolbar buttons losing spacing in Xcode 26.1.1 Legacy Mode (UIDesignRequiresCompatibility)
We're using XCode 26.1.1
We do not have resource to adopt Liquid Glass design. Hence, we are using the following workaround
<key>UIDesignRequiresCompatibility</key>
<true/>
This is our Storyboard.
Pre XCode 26
Before XCode ... | https://stackoverflow.com/questions/79847470/uitoolbar-buttons-losing-spacing-in-xcode-26-1-1-legacy-mode-uidesignrequiresco | ios, swift, xcode, liquid-glass | 1,765,783,179 |
se_79847352 | stackoverflow | MOBILE_DEVELOPMENT | addGlobalMonitorForEvents not working on swift script | addGlobalMonitorForEvents not working on swift script
Hi I'm trying to build a script in swift that while it's running it can execute a function when a shortcut is pressed.
The problem I'm having is that addGlobalMonitorForEvents is not being triggered at all, even though the app it self, and terminal have Accessibili... | https://stackoverflow.com/questions/79847352/addglobalmonitorforevents-not-working-on-swift-script | swift, swift-compiler | 1,765,764,552 |
se_79847015 | stackoverflow | MOBILE_DEVELOPMENT | How to set up SwiftData models for future migrations | How to set up SwiftData models for future migrations
I am currently in the middle of developing an iOS app which uses SwiftData. I want to future proof my data models by laying the ground work for data migrations down the line but I am pretty new to the whole thing and would appreciate some help.
My app currently has ... | https://stackoverflow.com/questions/79847015/how-to-set-up-swiftdata-models-for-future-migrations | swift, swiftdata | 1,765,715,722 |
se_79767347 | stackoverflow | MOBILE_DEVELOPMENT | De-materialize UIVisualEffectView with UIGlassEffect | De-materialize UIVisualEffectView with UIGlassEffect
According to the WWDC session Build a UIKit app with the new design at 23:20 it should be possible to do it in an animation block by setting the effect to nil:
UIView.animate {
effectView.effect = nil
}
However when I try this, nothing happens and the view just s... | https://stackoverflow.com/questions/79767347/de-materialize-uivisualeffectview-with-uiglasseffect | ios, swift, uivisualeffectview, ios26, uiglasseffect | 1,758,113,669 |
se_79846590 | stackoverflow | MOBILE_DEVELOPMENT | Using dynamic VisualEffect at runtime in SwiftUI | Using dynamic VisualEffect at runtime in SwiftUI
I'm trying to have a set of custom VisualEffects in SwiftUI and call them at runtime, but I'm struggling with the type generics. Here's some really simple code of what I'm after, but the error is Type 'any VisualEffect' cannot conform to 'VisualEffect'. In a View I woul... | https://stackoverflow.com/questions/79846590/using-dynamic-visualeffect-at-runtime-in-swiftui | swift, swiftui | 1,765,638,006 |
se_79846681 | stackoverflow | MOBILE_DEVELOPMENT | How to check "Paste from Other Apps" Pasteboard permission status? | How to check "Paste from Other Apps" Pasteboard permission status?
I know users can set this per-app in Settings → [App Name] → Paste from Other Apps, but I can't find any API to programmatically check the current status.
Am I missing something, or is there really no way to query whether the user has set All... | https://stackoverflow.com/questions/79846681/how-to-check-paste-from-other-apps-pasteboard-permission-status | ios, swift, iphone | 1,765,651,454 |
se_79845319 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 SwiftUI app when keyboard is shown, the keyboard's toolbar covers the text input (it worked on iOS 18) | iOS 26 SwiftUI app when keyboard is shown, the keyboard's toolbar covers the text input (it worked on iOS 18)
When I have a text field on bottom of a list, then tap on it to show the keyboard that has a toolbar button, on iOS 26, the keyboard's toolbar covers the text field:
However, it worked fine on iOS 18. I w... | https://stackoverflow.com/questions/79845319/ios-26-swiftui-app-when-keyboard-is-shown-the-keyboards-toolbar-covers-the-tex | ios, swift, swiftui, ios26 | 1,765,582,983 |
se_79846531 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI Menu always appears at top of label - how to show it at center of tappable area? | SwiftUI Menu always appears at top of label - how to show it at center of tappable area?
I'm building a photo upload component in SwiftUI where the entire rectangular area should be tappable to show a Menu with options (Photo Library / Camera).
The problem: No matter what I try, the Menu popup always appears anchored ... | https://stackoverflow.com/questions/79846531/swiftui-menu-always-appears-at-top-of-label-how-to-show-it-at-center-of-tappab | ios, swift, swiftui, swiftui-menu | 1,765,629,636 |
se_79204034 | stackoverflow | MOBILE_DEVELOPMENT | nw_connection_copy_connected_local_endpoint_block_invoke [C35] Connection has no local endpoint | nw_connection_copy_connected_local_endpoint_block_invoke [C35] Connection has no local endpoint
I have an app which makes some requests in the background when launching it and navigating through the views. There are many endpoints requested.
I get this warning message many times printed in the Xcode Console:
What is ... | https://stackoverflow.com/questions/79204034/nw-connection-copy-connected-local-endpoint-block-invoke-c35-connection-has-no | ios, swift, xcode, connection, warnings | 1,732,030,011 |
se_79780243 | stackoverflow | MOBILE_DEVELOPMENT | Vision face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 but correct on iOS 18 with same code and image | Vision face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 but correct on iOS 18 with same code and image
I'm using Vision framework (DetectFaceLandmarksRequest) with the same code and the same test image to detect face landmarks. On iOS 18 everything works as expected: detected face landmarks align with the... | https://stackoverflow.com/questions/79780243/vision-face-landmarks-detectfacelandmarksrequest-shifted-on-ios-26-but-correct | ios, swift, apple-vision | 1,759,332,865 |
se_79837477 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 Spacer doesn't work in keyboard toolbar (but worked on iOS 18) | iOS 26 Spacer doesn't work in keyboard toolbar (but worked on iOS 18)
I need to layout a few text & image buttons on keyboard toolbar, and want to insert spacers to evenly lay them out. This worked on iOS 18. However, on iOS 26, all are cluttered together. See picture:
Here's a minimum repro you can play around w... | https://stackoverflow.com/questions/79837477/ios-26-spacer-doesnt-work-in-keyboard-toolbar-but-worked-on-ios-18 | ios, swift, swiftui | 1,764,816,706 |
se_79844988 | stackoverflow | MOBILE_DEVELOPMENT | Are render/input callbacks guaranteed to have stopped when AUAudioUnit.stopHardware() returns? | Are render/input callbacks guaranteed to have stopped when AUAudioUnit.stopHardware() returns?
I’m using an AUAudioUnit I/O unit for simultaneous playback + recording. While running, it invokes my:
inputHandler (called when input is available)
outputProvider (called to provide audio for playback)
As far as I under... | https://stackoverflow.com/questions/79844988/are-render-input-callbacks-guaranteed-to-have-stopped-when-auaudiounit-stophardw | ios, swift, audio, webrtc-ios | 1,765,551,646 |
se_79844834 | stackoverflow | MOBILE_DEVELOPMENT | Rounded corner of a cut-out arc using UIBezierPath | Rounded corner of a cut-out arc using UIBezierPath
I'm drawing a cut-out hole in CAShapeLayer using UIBezierPath, this is the code I have so far:
let view = UIView(
frame: CGRect(origin: .zero, size: CGSize(width: 500.0, height: 500.0))
)
view.backgroundColor = .clear
let shapeLayer = CAShapeLayer()
shapeLayer.fram... | https://stackoverflow.com/questions/79844834/rounded-corner-of-a-cut-out-arc-using-uibezierpath | ios, swift, uikit, core-animation | 1,765,538,858 |
se_79844275 | stackoverflow | MOBILE_DEVELOPMENT | How to open Picker menu when a button is pressed | How to open Picker menu when a button is pressed
I have a webcam and microphone button which, when pressed, should open the Picker menu for macOS SwiftUI. However, I tried everything and the Picker keeps using its own visual representation instead of the circular-style button I want, like the webcam one.
DevicePicker... | https://stackoverflow.com/questions/79844275/how-to-open-picker-menu-when-a-button-is-pressed | swift, swiftui, appkit | 1,765,478,499 |
se_79844777 | stackoverflow | MOBILE_DEVELOPMENT | Pushy iOS – interruption_level Not Delivered to iOS (Time-Sensitive Notifications) | Pushy iOS – interruption_level Not Delivered to iOS (Time-Sensitive Notifications)
I’m trying to send time-sensitive push notifications to iOS devices using Pushy.
According to Apple’s APNs and Pushy documentation, I should send interruption-level: time-sensitive inside the aps payload.
I’m sending notifications from... | https://stackoverflow.com/questions/79844777/pushy-ios-interruption-level-not-delivered-to-ios-time-sensitive-notification | ios, swift, push, payload, pushy | 1,765,535,354 |
se_41236710 | stackoverflow | MOBILE_DEVELOPMENT | Why do we add protocol conformance with extensions? | Why do we add protocol conformance with extensions?
If I have a class Christmas, and a protocol Merry, to make Christmas conform to Merry, many people would do it this way:
class Christmas {
...
}
extension Christmas: Merry {
...
}
It's also encouraged by Apple.
However, isn't it more convenient to jus... | https://stackoverflow.com/questions/41236710/why-do-we-add-protocol-conformance-with-extensions | swift, protocols, swift-extensions | 1,482,217,944 |
se_79844355 | stackoverflow | MOBILE_DEVELOPMENT | After SetFocusFilterIntent and App Groups app cannot be copied to another Mac | After SetFocusFilterIntent and App Groups app cannot be copied to another Mac
I have recently added a SetFocusFilterIntent target extension to my app which is a system utility which goes into the menu bar(Application is agent = YES). I have followed the approach in the WWDC22 video introducing Focus Intent and I have ... | https://stackoverflow.com/questions/79844355/after-setfocusfilterintent-and-app-groups-app-cannot-be-copied-to-another-mac | swift, macos, appintents | 1,765,486,209 |
se_79844271 | stackoverflow | MOBILE_DEVELOPMENT | Is There an Easier Way to Use Swift Code in Kotlin Multiplatform? Step-by-Step with Cocoapods | Is There an Easier Way to Use Swift Code in Kotlin Multiplatform? Step-by-Step with Cocoapods
Is there any new/easy way to call swift function from kotlin directly in kmp project?
or
Can anyone explain the same using cocoapods step by step? | https://stackoverflow.com/questions/79844271/is-there-an-easier-way-to-use-swift-code-in-kotlin-multiplatform-step-by-step-w | swift, kotlin, kotlin-exposed, kmp, cinterop | 1,765,478,029 |
se_76115273 | stackoverflow | MOBILE_DEVELOPMENT | How to use any keyword for protocols to conform with Equatable? | How to use any keyword for protocols to conform with Equatable?
I want to make my protocol conform to Equatable. However, whenever I use the protocol, I get an error Type any {protocol} does not conform to Equatable.
protocol ExampleDataProtocol: Equatable {
var someData: Int { get set }
}
public extension ExampleD... | https://stackoverflow.com/questions/76115273/how-to-use-any-keyword-for-protocols-to-conform-with-equatable | swift | 1,682,544,931 |
se_79843349 | stackoverflow | MOBILE_DEVELOPMENT | CMReadySampleBuffer.copyPCMData() fails with -12731 (kCMSampleBufferError_RequiredParameterMissing) error | CMReadySampleBuffer.copyPCMData() fails with -12731 (kCMSampleBufferError_RequiredParameterMissing) error
I'm trying to figure out how to use the new outputProvider API on AVAssetReader. Specifically, I want to open a media file (video or audio), extract its audio, and write it back out as PCM. I have the following co... | https://stackoverflow.com/questions/79843349/cmreadysamplebuffer-copypcmdata-fails-with-12731-kcmsamplebuffererror-requir | ios, swift, audio, avfoundation, core-media | 1,765,393,033 |
se_74423799 | stackoverflow | MOBILE_DEVELOPMENT | How to size content for presentation detents in SwiftUI | How to size content for presentation detents in SwiftUI
I can display a sheet with a custom height with detents in SwiftUI like this.
.sheet(isPresented: $showSheet) {
MySheet()
presentationDetents([.height(500), .large])
}
Is there a way that I can measure the exact height of my view MySheet and pass thi... | https://stackoverflow.com/questions/74423799/how-to-size-content-for-presentation-detents-in-swiftui | swift, swiftui, ios16 | 1,668,365,374 |
se_60334798 | stackoverflow | MOBILE_DEVELOPMENT | iOS create generic Alamofire request using swift | iOS create generic Alamofire request using swift
Recently I have started learning iOS app development using swift so I am new to it. I want to implement rest api call in swift & found that we can achieve this using URLRequest. So I have written generic method to call all type(like get, put, post) of rest api as below.... | https://stackoverflow.com/questions/60334798/ios-create-generic-alamofire-request-using-swift | ios, swift, alamofire | 1,582,274,037 |
se_67995230 | stackoverflow | MOBILE_DEVELOPMENT | Nav bar does not fully cover top of phone screen | Nav bar does not fully cover top of phone screen
I added a nav bar with no nav controller and so the nav bar is only a strip. Is there any way to make the nav bar cover the whole top of the phone screen? | https://stackoverflow.com/questions/67995230/nav-bar-does-not-fully-cover-top-of-phone-screen | ios, swift, uinavigationbar | 1,623,806,580 |
se_79748969 | stackoverflow | MOBILE_DEVELOPMENT | UIBarButtonSystemItemDone shows blue checkmark and doesn't respect appearance's `tintColor` under iOS26 | UIBarButtonSystemItemDone shows blue checkmark and doesn't respect appearance's `tintColor` under iOS26
Creating a simple UIBarButtonItem on iOS26:
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
... | https://stackoverflow.com/questions/79748969/uibarbuttonsystemitemdone-shows-blue-checkmark-and-doesnt-respect-appearances | swift, objective-c, uikit, ios26 | 1,756,378,866 |
se_79843254 | stackoverflow | MOBILE_DEVELOPMENT | Swift SelectionValue Cannot be inferred in Picker with user defined class enums | Swift SelectionValue Cannot be inferred in Picker with user defined class enums
I'm going round in circles on this! See the code snippet. My original error is in the SettingsView on the Picker. Generic parameter SelectionValue ($settings) could not be inferred. If I add the @Binding macro, and add the Type (AppSett... | https://stackoverflow.com/questions/79843254/swift-selectionvalue-cannot-be-inferred-in-picker-with-user-defined-class-enums | swift, swiftui | 1,765,386,941 |
se_79842375 | stackoverflow | MOBILE_DEVELOPMENT | My Swift for in loop is not stopping when I call an await function | My Swift for in loop is not stopping when I call an await function
I have a for in loop in my ViewModel that I want to process elements in an array one at a time, and if the API result from each element has a count of 1, then continue to the next element in the array, but if the result count is greater than 1, then I... | https://stackoverflow.com/questions/79842375/my-swift-for-in-loop-is-not-stopping-when-i-call-an-await-function | arrays, swift, async-await | 1,765,315,745 |
se_77715899 | stackoverflow | MOBILE_DEVELOPMENT | Implementing UPI Payments in Flutter: Handling Google Pay Intent in iOS | Implementing UPI Payments in Flutter: Handling Google Pay Intent in iOS
I am currently working on a Flutter app that involves UPI (Unified Payments Interface) payments. In the Android part of the app, I've successfully implemented UPI payments using method channels. I've created native Kotlin code to handle the intent... | https://stackoverflow.com/questions/77715899/implementing-upi-payments-in-flutter-handling-google-pay-intent-in-ios | swift, flutter, dart, url-launcher | 1,703,571,317 |
se_77814385 | stackoverflow | MOBILE_DEVELOPMENT | SwiftData: Batch delete failed due to mandatory OTO nullify inverse | SwiftData: Batch delete failed due to mandatory OTO nullify inverse
I'm trying to remove all data (for debugging purposes). Let's say I have two models:
@Model
class School {
@Relationship(deleteRule: .nullify, inverse: \Student.school) var students: [Student]
init(students: [Student]) {
self.students... | https://stackoverflow.com/questions/77814385/swiftdata-batch-delete-failed-due-to-mandatory-oto-nullify-inverse | swift, swiftdata | 1,705,221,719 |
se_79842346 | stackoverflow | MOBILE_DEVELOPMENT | How to detect the globally active mouse cursor type in macOS? | How to detect the globally active mouse cursor type in macOS?
I'm working on a macOS app using Swift, and I need to detect the currently active mouse cursor globally, not just inside my app window.
For example, if the user moves the mouse over a text field in Safari or Chrome, I want to detect that the cursor changed ... | https://stackoverflow.com/questions/79842346/how-to-detect-the-globally-active-mouse-cursor-type-in-macos | swift, macos, appkit | 1,765,313,404 |
se_79842599 | stackoverflow | MOBILE_DEVELOPMENT | Notification Permission Issue in Device Activity Report Extension (iOS 26) | Notification Permission Issue in Device Activity Report Extension (iOS 26)
I'm facing a problem where notification permissions are working fine in the main app, but failing in the Device Activity Report Extension on iOS 2enter image description here6. This issue wasn’t present in earlier iOS versions. Despite having n... | https://stackoverflow.com/questions/79842599/notification-permission-issue-in-device-activity-report-extension-ios-26 | ios, swift, push-notification, screen-time | 1,765,346,734 |
se_59456657 | stackoverflow | MOBILE_DEVELOPMENT | Send informations with Bluetooth in Swift IOS language | Send informations with Bluetooth in Swift IOS language
I'm actually in informatics school and I have some trouble with the connection between my own self signed app coded in Swift(Xcode 11.3 and for IOS 13.2 device) and a BLE module SH-HC-08 plugged on an Arduino. (UUID : FE60E626-C58C-69F5-324F-43C7C409A93D)
I'm tota... | https://stackoverflow.com/questions/59456657/send-informations-with-bluetooth-in-swift-ios-language | ios, swift, iphone, xcode, core-bluetooth | 1,577,109,921 |
se_77915067 | stackoverflow | MOBILE_DEVELOPMENT | How to make @Transient type in a @Model to update the UI when changed? | How to make @Transient type in a @Model to update the UI when changed?
When we wrap a @Model with @Transient, it's outside scope of the SwiftData, but still i want the @Transient property to Update in the UI, when its value changes. Is it something by default in design of SwiftData or there are any work arounds. Here ... | https://stackoverflow.com/questions/77915067/how-to-make-transient-type-in-a-model-to-update-the-ui-when-changed | swift, swiftdata | 1,706,719,985 |
se_79842084 | stackoverflow | MOBILE_DEVELOPMENT | How to set the custom DNS with the Network client on iOS | How to set the custom DNS with the Network client on iOS
We are facing a DNS resolution issue with a specific ISP, where our domain name does not resolve correctly using the system DNS. However, the same domain works as expected when a custom DNS resolver is used.
On Android, this is straightforward to handle by confi... | https://stackoverflow.com/questions/79842084/how-to-set-the-custom-dns-with-the-network-client-on-ios | ios, swift, iphone, dns | 1,765,292,110 |
se_79840310 | stackoverflow | MOBILE_DEVELOPMENT | Custom ProgressView in a SwiftUI widget | Custom ProgressView in a SwiftUI widget
I’m trying to add a linear ProgressView to a SwiftUI Widget that counts up over time and uses a LinearGradient instead of a solid color for the progress bar.
First I tried using the built-in ProgressView with a ProgressViewStyle but I notice that it stops counting up after I add... | https://stackoverflow.com/questions/79840310/custom-progressview-in-a-swiftui-widget | ios, swift, swiftui, widget | 1,765,120,446 |
se_77156438 | stackoverflow | MOBILE_DEVELOPMENT | How to run an async/await task when application will be terminated? | How to run an async/await task when application will be terminated?
I want to update or end a Live Activity when the application is terminated, but those functions are async, and anything inside Task{ } is not get called in the applicationWillTerminate(_) function.
func applicationWillTerminate(_ application: UIApplic... | https://stackoverflow.com/questions/77156438/how-to-run-an-async-await-task-when-application-will-be-terminated | ios, swift, async-await, activitykit, widgetliveactivity | 1,695,375,175 |
se_66432420 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI TapGesture Not Working with NavigationLink in List on iOS | SwiftUI TapGesture Not Working with NavigationLink in List on iOS
When I use .simultaneousGesture(TapGesture().onEnded{ //code to run }) on a NavigationLink in SwiftUI for iOS, the code runs fine and the link opens.
However, if the NavigationLink is in a List, the code runs but the link does not open.
Is there another... | https://stackoverflow.com/questions/66432420/swiftui-tapgesture-not-working-with-navigationlink-in-list-on-ios | ios, swift, swiftui, swiftui-list, swiftui-navigationlink | 1,614,651,959 |
se_79841359 | stackoverflow | MOBILE_DEVELOPMENT | Metal shader compilation fails on Xcode 26.1.1 due to missing Metal Toolchain | Metal shader compilation fails on Xcode 26.1.1 due to missing Metal Toolchain
I am trying to compile some Metal shaders using Xcode 26.1.1 on macOS 26.1, but it fails with this:
error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain
The first thing that I'... | https://stackoverflow.com/questions/79841359/metal-shader-compilation-fails-on-xcode-26-1-1-due-to-missing-metal-toolchain | swift, xcode, metal | 1,765,229,498 |
se_59907344 | stackoverflow | MOBILE_DEVELOPMENT | How to get the confidence of a prediction from a MLModel (Machine Learning Model) in Swift 5 | How to get the confidence of a prediction from a MLModel (Machine Learning Model) in Swift 5
even though my code is pretty simplistic in what it is trying to do, basically I want to have the classifier model return an accuracy/confidence value for how accurate it thinks it's prediction is, on actual Xcode application ... | https://stackoverflow.com/questions/59907344/how-to-get-the-confidence-of-a-prediction-from-a-mlmodel-machine-learning-model | swift, xcode, machine-learning, coreml | 1,579,938,731 |
se_27875463 | stackoverflow | MOBILE_DEVELOPMENT | How do I get a list of countries? | How do I get a list of countries?
I've already seen two similar questions to mine, but the answers for those questions do not work for me. I have an old project with a list of countries manually typed out inside a set of square brackets.
I can easily use this in my pickerView but I'm wondering if there is a more eff... | https://stackoverflow.com/questions/27875463/how-do-i-get-a-list-of-countries | ios, swift, cocoa-touch, nsarray, nslocale | 1,420,887,632 |
se_79840894 | stackoverflow | MOBILE_DEVELOPMENT | issues with workmanager plugin | issues with workmanager plugin
I implemented workmanager in my app and it was working perfectly until I upgraded the package to the latest one and started having this error that says:
Swift Compiler Error (Xcode): Type 'WorkmanagerPlugin' has no member 'registerTask'
/Users/mac/Documents/work/catholicpay/ios/Runner/A... | https://stackoverflow.com/questions/79840894/issues-with-workmanager-plugin | ios, swift, flutter, flutter-workmanager | 1,765,193,377 |
se_59544709 | stackoverflow | MOBILE_DEVELOPMENT | Swift - Chunk array to different sizes | Swift - Chunk array to different sizes
I have this extension:
extension Array {
func chunkedElements(into size: Int) -> [[Element]] {
return stride(from: 0, to: count, by: size).map {
Array(self[$0 ..< Swift.min($0 + size, count)])
}
}
}
This function splits the array by size: In... | https://stackoverflow.com/questions/59544709/swift-chunk-array-to-different-sizes | arrays, swift | 1,577,798,783 |
se_79839945 | stackoverflow | MOBILE_DEVELOPMENT | What are the requirements for generating a HIDVirtualDevice on MacOS | What are the requirements for generating a HIDVirtualDevice on MacOS
The Apple docs say that one can create virtual HID devices on MacOS. I'm already using uhid on Linux for a project of mine and I thought about porting to project to Mac as generating a HIDVirtualDevice on Mac seems straight forward from reading the d... | https://stackoverflow.com/questions/79839945/what-are-the-requirements-for-generating-a-hidvirtualdevice-on-macos | swift, macos, codesign | 1,765,054,528 |
se_79840471 | stackoverflow | MOBILE_DEVELOPMENT | Seeking for the best practice to add 'eye' option to secureField text box in swift | Seeking for the best practice to add 'eye' option to secureField text box in swift
I'd like to add to my an option to expose the password value in my secure field textbox. Currently I'm doing it by rendering TextField if showPassword is on, and SecureField if it's off. However, the re-rendering itself cause an... | https://stackoverflow.com/questions/79840471/seeking-for-the-best-practice-to-add-eye-option-to-securefield-text-box-in-swi | ios, swift, macos, user-interface | 1,765,139,396 |
se_79840668 | stackoverflow | MOBILE_DEVELOPMENT | Metal shader fails to compile on macOS 26.1 | Metal shader fails to compile on macOS 26.1
I’m working on a SwiftUI / Metal project that implements a dynamic multicolor artwork background gradient (similar to Apple Music). The shader is a [[ stitchable ]] Metal function used inside a SwiftUI .colorEffect(ShaderLibrary.gradient(...)).
Everything works on Apple Sili... | https://stackoverflow.com/questions/79840668/metal-shader-fails-to-compile-on-macos-26-1 | swift, xcode, macos, swiftui, metal | 1,765,177,056 |
se_79827662 | stackoverflow | MOBILE_DEVELOPMENT | How can I migrate NotificationCenter code to Swift 6 concurrency? | 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 the object is equal to a particular NSObjectvalue.
For ... | https://stackoverflow.com/questions/79827662/how-can-i-migrate-notificationcenter-code-to-swift-6-concurrency | ios, swift, concurrency, foundation | 1,763,867,102 |
se_79840165 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI sheet with TextField using autocorrectionDisabled() prevents view model deinit after editing | SwiftUI sheet with TextField using autocorrectionDisabled() prevents view model deinit after editing
I present a view as a sheet that contains a TextField and a viewModel. The sheet uses .autocorrectionDisabled() on the TextField.
If I open the sheet and dismiss it without editing, the viewModel is released as expecte... | https://stackoverflow.com/questions/79840165/swiftui-sheet-with-textfield-using-autocorrectiondisabled-prevents-view-model | ios, swift, swiftui | 1,765,099,511 |
se_67956767 | stackoverflow | MOBILE_DEVELOPMENT | How to get a view to update automatically after period of inactivity? | How to get a view to update automatically after period of inactivity?
I am trying to add a timeout feature to my SwiftUI app. The view should be updated when timeout is reached. I have found code on a different thread, which works for the timeout part, but I cannot get the view to update.
I am using a static property ... | https://stackoverflow.com/questions/67956767/how-to-get-a-view-to-update-automatically-after-period-of-inactivity | ios, swift, swiftui, uiapplication | 1,623,576,646 |
se_59103163 | stackoverflow | MOBILE_DEVELOPMENT | Dismiss view from view model [MODAL PAGE] | Dismiss view from view model [MODAL PAGE]
I'm using swiftUI and combine, I'have some business logic in my VM. Some results have to dismiss my view.
I'v used this one in some views :
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
self.presentationMode.wrappedValue.dismiss()
I wan... | https://stackoverflow.com/questions/59103163/dismiss-view-from-view-model-modal-page | swift, swiftui, combine | 1,575,023,734 |
se_79839901 | stackoverflow | MOBILE_DEVELOPMENT | GlassEffectContainer breaks ScrollView orientation and spacing | GlassEffectContainer breaks ScrollView orientation and spacing
I added a GlassEffectContainer to a ScrollView containing views with a glassEffect modifier. I did this so that their different Liquid Glass effects could be combined, they could morph, and performance would improve.
On the simulator it worked great, but w... | https://stackoverflow.com/questions/79839901/glasseffectcontainer-breaks-scrollview-orientation-and-spacing | ios, swift, swiftui, liquid-glass, glasseffectcontainer | 1,765,049,756 |
se_79839610 | stackoverflow | MOBILE_DEVELOPMENT | Different behavior when initializing object within init() vs onAppear - Confused | Different behavior when initializing object within init() vs onAppear - Confused
If have tinkered with Swift AVAudioPlayer.
Currently I'm confused because when I initialize the object within onAppear, then everything works fine.
When I use init() for initialization, then the object is nil afterwards.
I used the debugg... | https://stackoverflow.com/questions/79839610/different-behavior-when-initializing-object-within-init-vs-onappear-confused | ios, swift, swiftui | 1,765,014,052 |
se_61142986 | stackoverflow | MOBILE_DEVELOPMENT | UIImage content mode aspectFit and bottom | UIImage content mode aspectFit and bottom
Is it possible to set the contentMode for my UIImage to .scaleAspectFit and .bottom simultaneously ?
This is how my image looks like at the moment:
UIImageView:
let nightSky: UIImageView = {
let v = UIImageView()
v.image = UIImage(named: "nightSky")
v.translat... | https://stackoverflow.com/questions/61142986/uiimage-content-mode-aspectfit-and-bottom | ios, swift, uiimageview, contentmode | 1,586,530,723 |
se_79829274 | stackoverflow | MOBILE_DEVELOPMENT | RealityKit's custom light entity causes a black artifact on my 3D model | 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 = Transform(pitch: -Float.pi / 2, yaw: 0, roll: ... | https://stackoverflow.com/questions/79829274/realitykits-custom-light-entity-causes-a-black-artifact-on-my-3d-model | ios, swift, realitykit | 1,764,040,996 |
se_69736487 | stackoverflow | MOBILE_DEVELOPMENT | Releasing WKNavigationAction subclass crashes on iOS 15 | Releasing WKNavigationAction subclass crashes on iOS 15
For unit testing I have subclassed WKNavigationAction. It's a common practice and can be found across the internet and in big SDKs, too.
On iOS 15 releasing an instance of it leads to a crash inside WebKit.
Stacktrace:
Thread 1 Queue : com.apple.main-thread (seri... | https://stackoverflow.com/questions/69736487/releasing-wknavigationaction-subclass-crashes-on-ios-15 | ios, swift, webkit, ios15 | 1,635,328,543 |
se_30426807 | stackoverflow | MOBILE_DEVELOPMENT | How can I change the duration of vibration in iOS / Swift? | How can I change the duration of vibration in iOS / Swift?
It's possible to make the device vibrate with AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)). But is there also a way to set the duration of the vibration process? I want it to be shorter.
I thought of stopping the vibration before it fully... | https://stackoverflow.com/questions/30426807/how-can-i-change-the-duration-of-vibration-in-ios-swift | ios, swift, iphone-vibrate | 1,432,491,642 |
se_40597189 | stackoverflow | MOBILE_DEVELOPMENT | Character Array to string in Swift | Character Array to string in Swift
The output of the [Character] Array currently is:
["E", "x", "a", "m", "p", "l", "e"]
It should be:
Example
It could be that " is in the array, like this: """. That output should be ".
Thank you! | https://stackoverflow.com/questions/40597189/character-array-to-string-in-swift | arrays, swift, string, type-conversion, character | 1,479,155,025 |
se_59084240 | stackoverflow | MOBILE_DEVELOPMENT | RealityKit – How to set a ModelEntity's transparency? | RealityKit – How to set a ModelEntity's transparency?
In SceneKit, there are lots of options such as
Use alpha channel of UIColor via SCNMaterial.(diffuse|emission|ambient|...).contents
Use SCNMaterial.transparency (a CGFloat from 0.0 to 1.0)
Use SCNMaterial.transparent (another SCNMaterialProperty) ... | https://stackoverflow.com/questions/59084240/realitykit-how-to-set-a-modelentitys-transparency | swift, augmented-reality, realitykit, reality-composer | 1,574,928,486 |
se_63793918 | stackoverflow | MOBILE_DEVELOPMENT | LiDAR and RealityKit – Capture a Real World Texture for a Scanned Model | LiDAR and RealityKit – Capture a Real World Texture for a Scanned Model
Task
I would like to capture a real-world texture and apply it to a reconstructed mesh produced with a help of LiDAR scanner. I suppose that Projection-View-Model matrices should be used for that. A texture must be made from fixed Point-of-View, f... | https://stackoverflow.com/questions/63793918/lidar-and-realitykit-capture-a-real-world-texture-for-a-scanned-model | swift, arkit, metal, realitykit, roomplan | 1,599,567,927 |
se_57654973 | stackoverflow | MOBILE_DEVELOPMENT | Swift rounding down Date seconds to zero | Swift rounding down Date seconds to zero
I have a bunch of Date objects that I want to perform calculations on, for these calculations I dont need second precision so I am attempting to "zero out" the seconds on my Dates. This all works fine unless the Date already has zero seconds in which case Swift decrements the ... | https://stackoverflow.com/questions/57654973/swift-rounding-down-date-seconds-to-zero | swift, date | 1,566,810,754 |
se_29789210 | stackoverflow | MOBILE_DEVELOPMENT | Set NSDate 0 seconds in swift | Set NSDate 0 seconds in swift
I'm trying to get NSDate from UIDatePicker, but it constantly returns me a date time with trailing 20 seconds. How can I manually set NSDate's second to zero in swift? | https://stackoverflow.com/questions/29789210/set-nsdate-0-seconds-in-swift | ios, swift, nsdate, nsdatepicker | 1,429,683,286 |
se_79839174 | stackoverflow | MOBILE_DEVELOPMENT | iOS Live Activities + multi-phase timers (Pomodoro / boxing rounds) without push notifications – is proper sync even possible? | iOS Live Activities + multi-phase timers (Pomodoro / boxing rounds) without push notifications – is proper sync even possible?
iOS Live Activities + multi-phase timers (Pomodoro / boxing rounds) without push notifications – is proper sync even possible?
Hey everyone 👋
I’m building a Pomodoro timer and a boxing/round ... | https://stackoverflow.com/questions/79839174/ios-live-activities-multi-phase-timers-pomodoro-boxing-rounds-without-push | ios, swift, widget, widgetliveactivity | 1,764,956,949 |
se_69055147 | stackoverflow | MOBILE_DEVELOPMENT | evaluateJavaScript WKWebView iOS 15 not working | evaluateJavaScript WKWebView iOS 15 not working
I'm using WebCrypto library to decrypt the data but it's not working on iOS 15
Its working fine in iOS 14
I have checked the evaluateJavaScript function of webView is throwing error
Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScri... | https://stackoverflow.com/questions/69055147/evaluatejavascript-wkwebview-ios-15-not-working | swift, ios15, webcrypto-api | 1,630,757,401 |
se_47867403 | stackoverflow | MOBILE_DEVELOPMENT | Only hide Tab Bar on one view inside navigation stack | Only hide Tab Bar on one view inside navigation stack
I have a UIViewController that has hidesBottomBarOnPush set to true in the storyboard. The view is pushed on top of a UINavigationController stack. This UINavigationController is inside a UITabBarController. This successfully hides the UITabBar on push.
However, wh... | https://stackoverflow.com/questions/47867403/only-hide-tab-bar-on-one-view-inside-navigation-stack | ios, swift | 1,513,595,995 |
se_79829980 | stackoverflow | MOBILE_DEVELOPMENT | no products or categories on the ViewController in TableView in iOS app with api woocommerce | 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 empty screen. In the final re... | https://stackoverflow.com/questions/79829980/no-products-or-categories-on-the-viewcontroller-in-tableview-in-ios-app-with-api | ios, swift, woocommerce | 1,764,088,655 |
se_65276194 | stackoverflow | MOBILE_DEVELOPMENT | Regex in Swift matching single quotes does not find matches | Regex in Swift matching single quotes does not find matches
I am using this regex in Swift:
let regex = try! NSRegularExpression(pattern: "^[a-zA-Zåçêëèïîìæôöòûùÿáíóúñ]+(?:[-' ][a-zA-Zåçêëèïîìæôöòûùÿáíóúñ]+)*$")
let range = NSRange(location: 0, length: newValue.utf16.count)
if regex.firstMatch(in: value, options: [],... | https://stackoverflow.com/questions/65276194/regex-in-swift-matching-single-quotes-does-not-find-matches | swift, regex, validation | 1,607,866,236 |
se_79837216 | stackoverflow | MOBILE_DEVELOPMENT | BGContinuedProcessingTask - is this thing on? in UIKit, that is | BGContinuedProcessingTask - is this thing on? in UIKit, that is
Even in a very simple UIKit test project, I'm not able to get BGContinuedProcessingTask (new in iOS 26) to do anything.
But using essentially the same code in a SwiftUI project, it works fine.
So my question is: has anyone been able to work out a way of g... | https://stackoverflow.com/questions/79837216/bgcontinuedprocessingtask-is-this-thing-on-in-uikit-that-is | ios, swift, background-process | 1,764,787,046 |
se_79837761 | stackoverflow | MOBILE_DEVELOPMENT | How fix error Animatable crosses into main actor-insolated | How fix error Animatable crosses into main actor-insolated
My sets:
Xcode 26 beta 2
Swift 6.3
I set default thread insolation: MainActor
I can often solve errors with my knowledge, but I can't figure out the Shape with ArithmeticVector implementation.
nonisolated struct MoodBodyShape: Shape {
xcode error:
Conformance... | https://stackoverflow.com/questions/79837761/how-fix-error-animatable-crosses-into-main-actor-insolated | swift, swiftui | 1,764,841,355 |
se_63127425 | stackoverflow | MOBILE_DEVELOPMENT | How to store encrypted data by SecureEnclave persistently | How to store encrypted data by SecureEnclave persistently
I have heard about Secure Enclave. In which after key generation, data can be encrypted by SecKeyCreateEncryptedData method.
My Use Case: I want to store some sensitive data persistently. For security purposes, I have encrypted data by above method using Secure... | https://stackoverflow.com/questions/63127425/how-to-store-encrypted-data-by-secureenclave-persistently | ios, objective-c, swift, iphone | 1,595,913,162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.