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_79882507 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI .onOpenURL not called every time when opening app from Widget using Link(destination:) | SwiftUI .onOpenURL not called every time when opening app from Widget using Link(destination:)
I am opening my app from a Widget using a custom URL scheme.
The app does open every time, but .onOpenURL is not called consistently — sometimes it fires, sometimes it does not.
Widget code
Link(destination: makeBMILink(entr... | https://stackoverflow.com/questions/79882507/swiftui-onopenurl-not-called-every-time-when-opening-app-from-widget-using-link | ios, swift, swiftui, widget | 1,770,188,008 |
se_79885505 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI issue with keyboard | SwiftUI issue with keyboard
I'm struggling with trying not to move tabbar when my keyboard appears
Here is the code of my main tabbar screen
var body: some View {
VStack(spacing: 0) {
pomeHeader
switch viewModel.selectedTab {
case .activities:
... | https://stackoverflow.com/questions/79885505/swiftui-issue-with-keyboard | ios, swift, swiftui | 1,770,594,893 |
se_79677629 | stackoverflow | MOBILE_DEVELOPMENT | ScrollViews at the bottom of NavigationStack cause the navigation title to be invisible in iOS 26 | ScrollViews at the bottom of NavigationStack cause the navigation title to be invisible in iOS 26
I have a NavigationStack that contains a ScrollView at the bottom of the screen.
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Text("Some Content")
... | https://stackoverflow.com/questions/79677629/scrollviews-at-the-bottom-of-navigationstack-cause-the-navigation-title-to-be-in | ios, swift, swiftui, swiftui-navigationstack, swiftui-scrollview | 1,750,770,632 |
se_79883154 | stackoverflow | MOBILE_DEVELOPMENT | Is it possible to get macOS window border radius using CGWindowListCopyWindowInfo on macOS Tahoe+ | Is it possible to get macOS window border radius using CGWindowListCopyWindowInfo on macOS Tahoe+
macOS Tahoe windows can have various border radii. I need a way to measure a given window's border radius in pixels.
Currently, I get a list of windows using CGWindowListCopyWindowInfo and process it like:
guard let windo... | https://stackoverflow.com/questions/79883154/is-it-possible-to-get-macos-window-border-radius-using-cgwindowlistcopywindowinf | swift, objective-c, macos, macos-tahoe | 1,770,251,149 |
se_25329186 | stackoverflow | MOBILE_DEVELOPMENT | Safe (bounds-checked) array lookup in Swift, through optional bindings? | Safe (bounds-checked) array lookup in Swift, through optional bindings?
If I have an array in Swift, and try to access an index that is out of bounds, there is an unsurprising runtime error:
var str = ["Apple", "Banana", "Coconut"]
str[0] // "Apple"
str[3] // EXC_BAD_INSTRUCTION
However, I would have thought with ... | https://stackoverflow.com/questions/25329186/safe-bounds-checked-array-lookup-in-swift-through-optional-bindings | xcode, swift | 1,408,116,053 |
se_68292788 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI VideoPlayer, change default black background/side space | SwiftUI VideoPlayer, change default black background/side space
in SwiftUI I add a Videoplayer, but the frame is not really 16:9, but the video's are.
private let player = AVPlayer(url: URL(string: UserDefaults.standard.string(forKey: "videoURL") ?? "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample... | https://stackoverflow.com/questions/68292788/swiftui-videoplayer-change-default-black-background-side-space | swift, swiftui | 1,625,690,696 |
se_79885810 | stackoverflow | MOBILE_DEVELOPMENT | How to set icon as vector template to action extension? | How to set icon as vector template to action extension?
I have a Swift app for macOS, with an action extension in it. The extension contains following in its Info.plist file:
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
... | https://stackoverflow.com/questions/79885810/how-to-set-icon-as-vector-template-to-action-extension | swift, macos, info.plist | 1,770,637,220 |
se_79885567 | stackoverflow | MOBILE_DEVELOPMENT | iOS QR Code Scanning: Normalizing Orientation and Handling Side-Angle First Scans to Prevent Invalid Scans | iOS QR Code Scanning: Normalizing Orientation and Handling Side-Angle First Scans to Prevent Invalid Scans
In my application, QR codes are placed at fixed physical locations, and some users are trying to bypass the intended usage by copying the QR code image and scanning it from a different position or direction than ... | https://stackoverflow.com/questions/79885567/ios-qr-code-scanning-normalizing-orientation-and-handling-side-angle-first-scan | ios, swift, qr-code | 1,770,610,761 |
se_54195158 | stackoverflow | MOBILE_DEVELOPMENT | "failure preparing: bad parameter or other API misuse" while inserting | "failure preparing: bad parameter or other API misuse" while inserting
INSERT statement:
let db = Database.openDatabase()
let insertStatementString = "INSERT INTO SignupDetails VALUES (\((self.txtUsername.text!.trimmingCharacters(in: .whitespaces))), \((self.txtPassword.text!.trimmingCharacters(in: .whitespa... | https://stackoverflow.com/questions/54195158/failure-preparing-bad-parameter-or-other-api-misuse-while-inserting | ios, sql, swift, sqlite | 1,547,541,128 |
se_79884917 | stackoverflow | MOBILE_DEVELOPMENT | WidgetKit: Image from Assets.xcassets fails to load (errno = 2), but direct file access works | WidgetKit: Image from Assets.xcassets fails to load (errno = 2), but direct file access works
I am developing an iOS Widget using SwiftUI and WidgetKit. I am trying to load a simple background image into the widget, but I am facing a persistent issue where images inside the Asset Catalog (Assets.xcassets) are not foun... | https://stackoverflow.com/questions/79884917/widgetkit-image-from-assets-xcassets-fails-to-load-errno-2-but-direct-file | ios, swift, swiftui, widgetkit, asset-catalog | 1,770,475,707 |
se_73790307 | stackoverflow | MOBILE_DEVELOPMENT | Class property 'current' is unavailable from asynchronous contexts; Thread.current cannot be used from async contexts.; this is an error in Swift 6 | Class property 'current' is unavailable from asynchronous contexts; Thread.current cannot be used from async contexts.; this is an error in Swift 6
I am trying to figure out what thread or run loop I am on when in an async task. How can I get the thread or run loop from a task?
Task {
do {
print("l... | https://stackoverflow.com/questions/73790307/class-property-current-is-unavailable-from-asynchronous-contexts-thread-curre | swift, asynchronous, async-await | 1,663,693,706 |
se_79884698 | stackoverflow | MOBILE_DEVELOPMENT | What is the fragility in using Mirror(reflecting:_)? | What is the fragility in using Mirror(reflecting:_)?
I have heard/read from/in reliable sources that Swift’s ‘Mirror(reflecting:_) is not “production” ready. These warnings never came with an explanation. What is Swift/SwiftUI scared it might see?
Edit 1: Idea Expansion...
@preMacro
I used to have a SQLite wrapper lib... | https://stackoverflow.com/questions/79884698/what-is-the-fragility-in-using-mirrorreflecting | swift | 1,770,430,075 |
se_79852191 | stackoverflow | MOBILE_DEVELOPMENT | How can I remove extra indentation from CodeBlockItemListSyntax? | How can I remove extra indentation from CodeBlockItemListSyntax?
I am writing a method that runs a closure and measure how long it took the code to run. In the output, I want to include the actual source code that is run, so the method takes two parameters like this:
func measure<T>(_ block: () -> T, _ blockDescriptio... | https://stackoverflow.com/questions/79852191/how-can-i-remove-extra-indentation-from-codeblockitemlistsyntax | swift, swift-macro, swift-syntax | 1,766,311,181 |
se_79650309 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI animation causes WkWebView pointer to flicker | SwiftUI animation causes WkWebView pointer to flicker
I have two a WkWebView with an embedded YouTube player and a counter underneath that updates at a certain interval with a small animation. Every update causes the cursor to flicker back and forth between pointer and regular cursor:
Any way to fix this that doesn't... | https://stackoverflow.com/questions/79650309/swiftui-animation-causes-wkwebview-pointer-to-flicker | swift, animation, swiftui, wkwebview, mouse-cursor | 1,748,897,157 |
se_79884376 | stackoverflow | MOBILE_DEVELOPMENT | xcode uses wrong version of NSManagedObjectContext.perform | xcode uses wrong version of NSManagedObjectContext.perform
I increased the target version, and xcode started giving me an error
Expression is 'async' but is not marked with 'await'" on each usage of NSManagedObjectContext.perform().
let context: NSManagedObjectContext = ...
context.perform{...}
It thinks I use newe... | https://stackoverflow.com/questions/79884376/xcode-uses-wrong-version-of-nsmanagedobjectcontext-perform | swift | 1,770,387,564 |
se_79883592 | stackoverflow | MOBILE_DEVELOPMENT | Detecting Vibrations from Internal Vibration Motor Using Accelerometer | Detecting Vibrations from Internal Vibration Motor Using Accelerometer
I am wokring on an iOS app that triggers the internal vibration motor of the iPhone and while the phone vibrates, it collects accelerometer and gyroscope readings. I've visualized the data after collection and I could see the vibrations clearly on ... | https://stackoverflow.com/questions/79883592/detecting-vibrations-from-internal-vibration-motor-using-accelerometer | ios, swift, iphone | 1,770,300,590 |
se_79883939 | stackoverflow | MOBILE_DEVELOPMENT | How to make SwiftUI ScrollView's interactive keyboard dismissal include the input bar in .safeAreaInset? | How to make SwiftUI ScrollView's interactive keyboard dismissal include the input bar in .safeAreaInset?
I have a chat app with a ScrollView for messages and an input bar placed in .safeAreaInset(edge: .bottom). I'm using .scrollDismissesKeyboard(.interactively) which works great for dismissing the keyboard when s... | https://stackoverflow.com/questions/79883939/how-to-make-swiftui-scrollviews-interactive-keyboard-dismissal-include-the-inpu | ios, swift, swiftui, swiftui-scrollview | 1,770,336,027 |
se_71744888 | stackoverflow | MOBILE_DEVELOPMENT | How to make a SwiftUI view with rounded corners AND a border | How to make a SwiftUI view with rounded corners AND a border
VStack {
Text("some text")
Button("Ok") {}
.foregroundColor(.cyan)
.padding()
}
.padding()
.background(.red)
.border(.blue, width: 5)
.cornerRadius(20)
I want the entire view to have the blue border with rounded corners (instead of ... | https://stackoverflow.com/questions/71744888/how-to-make-a-swiftui-view-with-rounded-corners-and-a-border | swift, swiftui, border, viewmodifier | 1,649,115,993 |
se_24002733 | stackoverflow | MOBILE_DEVELOPMENT | Add an element to an array in Swift | Add an element to an array in Swift
Suppose I have an array, for example:
var myArray = ["Steve", "Bill", "Linus", "Bret"]
And later I want to push/append an element to the end of said array, to get:
["Steve", "Bill", "Linus", "Bret", "Tim"]
What method should I use?
And what about the case where I want to add a... | https://stackoverflow.com/questions/24002733/add-an-element-to-an-array-in-swift | arrays, swift | 1,401,740,991 |
se_58406224 | stackoverflow | MOBILE_DEVELOPMENT | How to detect when a TextField loses the focus in SwiftUI for iOS? | How to detect when a TextField loses the focus in SwiftUI for iOS?
TextField("Name", text: $name)
I found this method
func focusable(_ isFocusable: Bool = true, onFocusChange: @escaping (Bool) -> Void = { _ in }) -> some View
but it's only available for MacOS, How could I do something similar for iOS ? | https://stackoverflow.com/questions/58406224/how-to-detect-when-a-textfield-loses-the-focus-in-swiftui-for-ios | ios, swift, swiftui | 1,571,203,258 |
se_79882829 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI WebSocket, onChange of a StatObject property fail to trigger though property value changes | SwiftUI WebSocket, onChange of a StatObject property fail to trigger though property value changes
I use a WebSocketManager to collect messages from a server. There are two types of messages : text messages and data messages. Let us focus on data messages only.
class WebSocketManager: ObservableObject {
@Published... | https://stackoverflow.com/questions/79882829/swiftui-websocket-onchange-of-a-statobject-property-fail-to-trigger-though-prop | swift, swiftui, websocket, onchange, observableobject | 1,770,215,856 |
se_46167720 | stackoverflow | MOBILE_DEVELOPMENT | AppRTC mach-or errors | AppRTC mach-or errors
I'm getting Mach-O errors on a clean install of AppRTC in swift.
I create a new project in xcode 8.3.3 and run.
I add:
pod ‘AppRTC‘
to my podfile, and use pod install.
When complete, I disable bitcode.
This is running on a device, cleaned the code and I'm stumped! | https://stackoverflow.com/questions/46167720/apprtc-mach-or-errors | swift, apprtc | 1,505,188,949 |
se_79883308 | stackoverflow | MOBILE_DEVELOPMENT | I can't get a check mark to display using a custom toggle style in an inner ForEach View | I can't get a check mark to display using a custom toggle style in an inner ForEach View
I have an outer and an inner ForEach View. The outer view displays a "category" and the inner view displays a list of foods in that "category" (think: shopping list). When I click on the box, I don't see the check mark. I h... | https://stackoverflow.com/questions/79883308/i-cant-get-a-check-mark-to-display-using-a-custom-toggle-style-in-an-inner-fore | swift, swiftui, swiftui-foreach | 1,770,278,345 |
se_79883276 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 Liquid Glass: UITabBar overrides selected title text color after trait changes, causing icon and title color mismatch | iOS 26 Liquid Glass: UITabBar overrides selected title text color after trait changes, causing icon and title color mismatch
I’m seeing unexpected UITabBar behavior on iOS 26 when Liquid Glass is enabled.
I’m using UITabBarAppearance with a dynamic UIColor to keep the selected tab bar icon and title text in sync (blue... | https://stackoverflow.com/questions/79883276/ios-26-liquid-glass-uitabbar-overrides-selected-title-text-color-after-trait-ch | ios, swift, uikit, ios26, liquid-glass | 1,770,275,090 |
se_79883258 | stackoverflow | MOBILE_DEVELOPMENT | Regarding the issue with the engine.mainMixerNode.outputVolume setting | Regarding the issue with the engine.mainMixerNode.outputVolume setting
When I write code in Swift with engine.mainMixerNode.outputVolume = 0, the code runs normally and can execute the renderCallback callback function. However, when I rewrite it in Objective-C with engine.mainMixerNode.outputVolume = 0, it doesn't wor... | https://stackoverflow.com/questions/79883258/regarding-the-issue-with-the-engine-mainmixernode-outputvolume-setting | swift, macos, core-audio, avaudioengine | 1,770,271,147 |
se_78781508 | stackoverflow | MOBILE_DEVELOPMENT | iOS bottom sheet with fraction detents UIKit | iOS bottom sheet with fraction detents UIKit
I would like to open bottom sheet with custom option and not medium or large detents.I checked in SwiftUI there is API called .fraction but couldn't find similar API in UIKit.
SwiftUI
Text("Detail")
.presentationDetents([.fraction(0.1)])
UIKit
if let sheet... | https://stackoverflow.com/questions/78781508/ios-bottom-sheet-with-fraction-detents-uikit | ios, swift, uikit, bottom-sheet | 1,721,707,125 |
se_35906892 | stackoverflow | MOBILE_DEVELOPMENT | How to Parse XML with JSON Output in Swift ios? | How to Parse XML with JSON Output in Swift ios?
I am trying to parse the output of a soap api.
<string xmlns="webservices.fmx.bz/">
{ "ui": [ { "t": "1234", "vid": "123", "cn": "Company Name" } ] }
</string>
i have been parseing it manually
var responseString = response.result.value?.stringByReplacingOccurrences... | https://stackoverflow.com/questions/35906892/how-to-parse-xml-with-json-output-in-swift-ios | ios, json, xml, swift, nsxmlparser | 1,457,579,645 |
se_79881093 | stackoverflow | MOBILE_DEVELOPMENT | How to correctly symbolicate PLCrashReporter crash reports using dSYM files? | How to correctly symbolicate PLCrashReporter crash reports using dSYM files?
I’m currently evaluating a setup where my iOS app uses PLCrashReporter to generate crash reports on the user’s device and upload them to my server for later analysis.
The crash detection, report generation and upload itself works fine.
What I... | https://stackoverflow.com/questions/79881093/how-to-correctly-symbolicate-plcrashreporter-crash-reports-using-dsym-files | ios, swift, xcode, plcrashreporter | 1,770,036,129 |
se_48395724 | stackoverflow | MOBILE_DEVELOPMENT | imageview under pulsator with swift 4 | imageview under pulsator with swift 4
I am trying to show an UIImage with pulse effect, for this I use pulsator framework. but the UIImage is under the pulsator, now I want to know if it is possible to set the UIImage on pulsator effect?
This is my code:
let img = UIImage(named: "img_usuario")
let img_view = UIImageVi... | https://stackoverflow.com/questions/48395724/imageview-under-pulsator-with-swift-4 | swift, animation, uiimage, swift4 | 1,516,690,087 |
se_40193911 | stackoverflow | MOBILE_DEVELOPMENT | NSNetService dictionaryFromTXTRecord fails an assertion on invalid input | NSNetService dictionaryFromTXTRecord fails an assertion on invalid input
The input to dictionary(fromTXTRecord:) comes from the network, potentially from outside the app, or even the device. However, Apple's docs say:
... Fails an assertion if txtData cannot be represented as an NSDictionary object.
Failing an a... | https://stackoverflow.com/questions/40193911/nsnetservice-dictionaryfromtxtrecord-fails-an-assertion-on-invalid-input | ios, swift, cocoa, nsnetservice | 1,477,150,577 |
se_38612456 | stackoverflow | MOBILE_DEVELOPMENT | Creating a circular progress bar around an image in swift | Creating a circular progress bar around an image in swift
I am trying to create a circular progress bar around an image as shown in the screenshot below. So far I have managed to create a round image with a green border using the code below:
self.image.layer.cornerRadius = self.image.frame.size.width / 2
self... | https://stackoverflow.com/questions/38612456/creating-a-circular-progress-bar-around-an-image-in-swift | ios, swift, uiimageview | 1,469,621,109 |
se_34915836 | stackoverflow | MOBILE_DEVELOPMENT | What is the use of Hashable and Equatable in Swift? When to use which? | What is the use of Hashable and Equatable in Swift? When to use which?
I know that Hashable is inherited from Equatable, but can you give me an example that requires Hashable, not just Equatable. Thanks! | https://stackoverflow.com/questions/34915836/what-is-the-use-of-hashable-and-equatable-in-swift-when-to-use-which | swift | 1,453,353,077 |
se_78457563 | stackoverflow | MOBILE_DEVELOPMENT | SVG image download with Kingfisher | SVG image download with Kingfisher
SVG, PNG images coming from api. I couldn't download SVG image with Kingfisher.
I tried this code but I got error. How can I fix this problem ? How can I download SVG image.
SVGImgProcessor:
import UIKit
import Kingfisher
import SVGKit
public struct SVGImgProcessor: ImageProcessor {... | https://stackoverflow.com/questions/78457563/svg-image-download-with-kingfisher | swift, svg, kingfisher | 1,715,303,837 |
se_79769313 | stackoverflow | MOBILE_DEVELOPMENT | Flutter iOS Build Fails After Xcode 26 Update: "Unable to find module dependency: 'CTweetNacl'" | Flutter iOS Build Fails After Xcode 26 Update: "Unable to find module dependency: 'CTweetNacl'"
Problem Description
After updating to Xcode 26, my Flutter iOS project fails to build with the following error:
Swift Compiler Error (Xcode): Unable to find module dependency: 'CTweetNacl'
Could not build ... | https://stackoverflow.com/questions/79769313/flutter-ios-build-fails-after-xcode-26-update-unable-to-find-module-dependency | swift, flutter, cocoapods, ios26, xcode26 | 1,758,272,263 |
se_79881854 | stackoverflow | MOBILE_DEVELOPMENT | Japanese Text remains in SwiftUI TextField after clearing the bound String | Japanese Text remains in SwiftUI TextField after clearing the bound String
I am experiencing an issue where Japanese Hiragana characters remain visible in a TextField even after the underlying @Binding string is set to empty.
Type Hiragana characters into the TextField.
Press "Done" to confirm the input.
Tap the "X... | https://stackoverflow.com/questions/79881854/japanese-text-remains-in-swiftui-textfield-after-clearing-the-bound-string | ios, swift, swiftui, textfield | 1,770,117,651 |
se_79543381 | stackoverflow | MOBILE_DEVELOPMENT | Stockfish NNUE file not loading in ChessKitEngine | Stockfish NNUE file not loading in ChessKitEngine
I am using ChessKitEngine to integrate Stockfish into my iOS app. I have added the nn-1111cefa1111.nnue file to my project's root folder and included it in the targets. The file was downloaded from the official Stockfish website, and I have not renamed it.
Issue
No mat... | https://stackoverflow.com/questions/79543381/stockfish-nnue-file-not-loading-in-chesskitengine | ios, swift, stockfish | 1,743,258,419 |
se_67731770 | stackoverflow | MOBILE_DEVELOPMENT | Xcode CarPlay Simulator will say "CarPlay Not Available" | Xcode CarPlay Simulator will say "CarPlay Not Available"
I currently have Xcode 12.4 installed.
I launch my iOS simulator (iPhone 12) and open CarPlay by I/O > External Display > CarPlay.
Error Screenshot
I keep getting "CarPlay Not Available. To use CarPlay, enable Siri..." for some reason.
I tried reinstal... | https://stackoverflow.com/questions/67731770/xcode-carplay-simulator-will-say-carplay-not-available | ios, swift, iphone, xcode | 1,622,165,364 |
se_57198005 | stackoverflow | MOBILE_DEVELOPMENT | Command CompileXIB failed with a nonzero exit code | Command CompileXIB failed with a nonzero exit code
I have the problem when building ios app using Xcode. That was going well before while building the project. Idk why it appears something weird on the error message. There is nothing wrong with my code actually.
The error message said to look like this:
The error mess... | https://stackoverflow.com/questions/57198005/command-compilexib-failed-with-a-nonzero-exit-code | ios, swift, xcode | 1,564,044,917 |
se_74429234 | stackoverflow | MOBILE_DEVELOPMENT | Open parent app from ShieldAction extension in iOS | Open parent app from ShieldAction extension in iOS
Using the ScreenTime API I have an app shielded with 2 button actions: one to remove the shield and open the app as normal, and the other to keep the app shielded and open the parent app instead.
Is there any way to open the parent app from the extension?
class Shiel... | https://stackoverflow.com/questions/74429234/open-parent-app-from-shieldaction-extension-in-ios | ios, swift | 1,668,417,069 |
se_79790161 | stackoverflow | MOBILE_DEVELOPMENT | Swift OpenAPI Package Generator ClientMiddleware Protocol Never Conforms | Swift OpenAPI Package Generator ClientMiddleware Protocol Never Conforms
When creating a new Authentication Middleware class that conforms to the ClientMiddleware protocol defined in the swift-openapi-runtime library, Xcode reports that the class does not conform to the protocol, even though the class implements the r... | https://stackoverflow.com/questions/79790161/swift-openapi-package-generator-clientmiddleware-protocol-never-conforms | swift, openapi, openapi-generator | 1,760,444,745 |
se_79796548 | stackoverflow | MOBILE_DEVELOPMENT | How can I check if my iOS custom keyboard has Full Access enabled without opening the keyboard? | How can I check if my iOS custom keyboard has Full Access enabled without opening the keyboard?
I'm developing a custom iOS keyboard extension, and I want to detect whether Full Access has been enabled — ideally without requiring the user to open the keyboard first.
I understand that when Full Access is off, the keybo... | https://stackoverflow.com/questions/79796548/how-can-i-check-if-my-ios-custom-keyboard-has-full-access-enabled-without-openin | ios, swift, keyboard, ios-keyboard-extension | 1,761,121,230 |
se_77541454 | stackoverflow | MOBILE_DEVELOPMENT | Call Swift code from Kotlin Multiplatform | Call Swift code from Kotlin Multiplatform
I have a simple swift class:
@objc public class Wallet: NSObject {
@objc public func getPrivateKey() -> String {
return ""
}
}
that i would like to call from Kotlin. I have also created a bridging header that looks like this:
#ifndef iosApp_Bridging_Header_h
#d... | https://stackoverflow.com/questions/77541454/call-swift-code-from-kotlin-multiplatform | android, ios, swift, kotlin, kotlin-multiplatform | 1,700,812,249 |
se_79881460 | stackoverflow | MOBILE_DEVELOPMENT | ZStack background ignoring safe area while content respects it, all scrolling together in ScrollView | ZStack background ignoring safe area while content respects it, all scrolling together in ScrollView
I'm trying to create a ScrollView with content at the top that has the following requirements:
The content (1. VStack) should be in a ZStack with a background color (or image)
The background should extend edge-to-edg... | https://stackoverflow.com/questions/79881460/zstack-background-ignoring-safe-area-while-content-respects-it-all-scrolling-to | ios, swift, swiftui, scrollview, swiftui-zstack | 1,770,067,475 |
se_65313313 | stackoverflow | MOBILE_DEVELOPMENT | How do I handle dragging onto the dock icon in SwiftUI? | How do I handle dragging onto the dock icon in SwiftUI?
I have set up a SwiftUI app that seems to accept images dropped onto the dock icon, but I cannot figure out where to handle the dropped image in my app code.
How can I handle dropping an image (or any particular file) onto the dock icon of a SwiftUI app?
Backgrou... | https://stackoverflow.com/questions/65313313/how-do-i-handle-dragging-onto-the-dock-icon-in-swiftui | swift, macos, swiftui | 1,608,064,677 |
se_58341820 | stackoverflow | MOBILE_DEVELOPMENT | Isn't there an easy way to pinch to zoom in an image in SwiftUI? | Isn't there an easy way to pinch to zoom in an image in SwiftUI?
I want to be able to resize and move an image in SwiftUI (like if it were a map) with pinch to zoom and drag it around.
With UIKit I embedded the image into a UIScrollView and it took care of it, but I don't know how to do it in SwiftUI.
I tried usi... | https://stackoverflow.com/questions/58341820/isnt-there-an-easy-way-to-pinch-to-zoom-in-an-image-in-swiftui | swift, image, scrollview, swiftui, pinchzoom | 1,570,798,832 |
se_79779756 | stackoverflow | MOBILE_DEVELOPMENT | Xcode 26.0.1 Type 'DataController' does not conform to protocol 'ObservableObject' | Xcode 26.0.1 Type 'DataController' does not conform to protocol 'ObservableObject'
When using CoreData in a Swift App, I was used to have a Class 'DataController : ObservableObject' to manage the CoreData Stack.
Starting a new Xcode26 Project and writing a class XYZ: ObservableObject results in errorMe... | https://stackoverflow.com/questions/79779756/xcode-26-0-1-type-datacontroller-does-not-conform-to-protocol-observableobjec | swift, observableobject | 1,759,304,533 |
se_78285748 | stackoverflow | MOBILE_DEVELOPMENT | AppShortcuts that reference iOS 17 specific AppIntents appear on iOS 16 and lead to crashes | AppShortcuts that reference iOS 17 specific AppIntents appear on iOS 16 and lead to crashes
I've got several AppIntents that use iOS 17 specific features and are therefore annotated with @available(iOS 17.0, *). The AppIntent is correctly only listed on iOS 17 in the Shortcuts app and hidden on iOS 16. However, if I r... | https://stackoverflow.com/questions/78285748/appshortcuts-that-reference-ios-17-specific-appintents-appear-on-ios-16-and-lead | ios, swift, sirikit, appintents | 1,712,434,390 |
se_33464925 | stackoverflow | MOBILE_DEVELOPMENT | Draw a grid with SpriteKit | Draw a grid with SpriteKit
What would be the best way to draw a grid like this by using the SpriteKit 2D game engine?
Requirements:
Input programatically the number of columns and rows (5x5, 10x3, 3x4 etc.).
Draw it programmatically using something like SKSpriteNode or SKShapeNode, since just using images of a square... | https://stackoverflow.com/questions/33464925/draw-a-grid-with-spritekit | ios, swift, sprite-kit | 1,446,398,541 |
se_79880752 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI crash with corrupted Live Photo | SwiftUI crash with corrupted Live Photo
I have a corrupted Live Photo in my Photos library. That photo doesn’t display correctly even in the Photos app. Its thumbnail is completely black, and only when I edit the Live Photo frames can I see which image it is.
In my app, I fetch assets and then use PHCachingImageManage... | https://stackoverflow.com/questions/79880752/swiftui-crash-with-corrupted-live-photo | swift, swiftui, uiimage, photo, phasset | 1,769,993,494 |
se_77993172 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI @Observable does not track changes in parent class properties to update the view | SwiftUI @Observable does not track changes in parent class properties to update the view
This is the model data
class A {
var p: Int = 1
func update() {
self.p = self.p + 1
}
}
@Observable
class BStore: A {
// nothing
}
This is the view
struct ContentView: View {
@State private var bSto... | https://stackoverflow.com/questions/77993172/swiftui-observable-does-not-track-changes-in-parent-class-properties-to-update | ios, swift, swiftui | 1,707,902,277 |
se_62904124 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI - How to put TextField in navigation bar like settings app | SwiftUI - How to put TextField in navigation bar like settings app
In the native Settings app, there's a NavigationView with a TextField inside of it that nicely transitions as the user scrolls:
I was able to create something similar using:
struct HomeView: View {
@State var searchQuery: String = ""
var body... | https://stackoverflow.com/questions/62904124/swiftui-how-to-put-textfield-in-navigation-bar-like-settings-app | ios, swift, swiftui | 1,594,761,315 |
se_79877635 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI Scroll View: Bug in Switching Between Vertical and Horizontal Scrolling | SwiftUI Scroll View: Bug in Switching Between Vertical and Horizontal Scrolling
If I switch the axis of the scroll like this:
struct ScrollViewTest: View {
@State private var axis: Axis.Set = .horizontal
var body: some View {
VStack {
ScrollView(axis) {
stack
}... | https://stackoverflow.com/questions/79877635/swiftui-scroll-view-bug-in-switching-between-vertical-and-horizontal-scrolling | ios, swift, swiftui, swiftui-scrollview | 1,769,578,719 |
se_79880861 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI ToolbarTitleMenu prevents navigation title truncation and pushes trailing toolbar items offscreen | SwiftUI ToolbarTitleMenu prevents navigation title truncation and pushes trailing toolbar items offscreen
I’m running into a layout issue with ToolbarTitleMenu in SwiftUI.
When I add a ToolbarTitleMenu to an inline navigation title, the title no longer truncates and instead takes priority over the trailing toolbar ite... | https://stackoverflow.com/questions/79880861/swiftui-toolbartitlemenu-prevents-navigation-title-truncation-and-pushes-trailin | ios, swift, swiftui, liquid-glass | 1,770,015,249 |
se_79880410 | stackoverflow | MOBILE_DEVELOPMENT | How to exclude Swift files from linting/compilation while keeping them visible in Xcode project? | How to exclude Swift files from linting/compilation while keeping them visible in Xcode project?
I have old Swift files in my Xcode project that I want to keep for reference, but they're causing compiler errors because they define structs with the same names as my current code.
Project Structure:
scratch/
├── code/
│ ... | https://stackoverflow.com/questions/79880410/how-to-exclude-swift-files-from-linting-compilation-while-keeping-them-visible-i | swift, xcode | 1,769,936,948 |
se_58360765 | stackoverflow | MOBILE_DEVELOPMENT | Swift 5.1 Error: [plugin] AddInstanceForFactory: No factory registered for id <CFUUID | Swift 5.1 Error: [plugin] AddInstanceForFactory: No factory registered for id <CFUUID
App crashes with the following error message
2019-10-12 20:01:34.332334-0700 Awesome App[26368:3535170] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600002903280> F8BB1C28-BAE8-11D6-9C31-00039315CD46
T... | https://stackoverflow.com/questions/58360765/swift-5-1-error-plugin-addinstanceforfactory-no-factory-registered-for-id-c | swift, swift5 | 1,570,943,400 |
se_71072427 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI searchable on NavigationView always shown, hides only on scroll | SwiftUI searchable on NavigationView always shown, hides only on scroll
I'm writing a fairly simple SwiftUI app about movies and I have this issue where the new .searchable modifier on NavigationView is always being shown, whereas it should be hidden, unless you pull down on the List.
It hides it correctly if I scroll... | https://stackoverflow.com/questions/71072427/swiftui-searchable-on-navigationview-always-shown-hides-only-on-scroll | ios, swift, swiftui, ios15, xcode13 | 1,644,528,090 |
se_65837717 | stackoverflow | MOBILE_DEVELOPMENT | Build Amazon Affiliate Link Swift | Build Amazon Affiliate Link Swift
I would like to be able to build an Amazon-Affiliate link, when a "normal" Amazon URL is given.
I tried using this structure:
http://www.amazon.com/dp/{ASIN}/?tag={trackingId}
as suggested here.
This is how I try to create the URL:
func getAmazonAffiliateLink() -> URL? {
if let r... | https://stackoverflow.com/questions/65837717/build-amazon-affiliate-link-swift | swift, url, affiliate | 1,611,275,392 |
se_79879508 | stackoverflow | MOBILE_DEVELOPMENT | Nested Scrolling of Lists within a Carousel erratically working on iOS26.2 physical devices | Nested Scrolling of Lists within a Carousel erratically working on iOS26.2 physical devices
I was using with satisfaction the snippet by @ChrisR from his post Carousel SwiftUI until I upgraded my iPhone and iPad to iOS26.2
In Chris' example I substituted the Coloured Rounded rectangles with scrollable list views. And ... | https://stackoverflow.com/questions/79879508/nested-scrolling-of-lists-within-a-carousel-erratically-working-on-ios26-2-physi | swift, swiftui, scroll, carousel, ios-26.2 | 1,769,785,779 |
se_79879842 | stackoverflow | MOBILE_DEVELOPMENT | Which thread should I call SceneKit's node manipulation APIs? | Which thread should I call SceneKit's node manipulation APIs?
In Apple's SceneKit sample code (download here: https://developer.apple.com/library/archive/samplecode/scenekit-2017/Introduction/Intro.html#//apple_ref/doc/uid/TP40017656), we have:
@implementation AAPLGameViewController
- (void)viewDidLoad {
self.g... | https://stackoverflow.com/questions/79879842/which-thread-should-i-call-scenekits-node-manipulation-apis | ios, swift, scenekit | 1,769,830,307 |
se_79873144 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI view state resetting after alert is shown | SwiftUI view state resetting after alert is shown
Seeing an issue in iOS 26.2 iPhone 17 simulator (haven't been able to reproduce on device), where a view's state is reset after an alert is shown.
In this example the first LibraryView has the issue when alert is shown, the second LibraryView maintains state as expecte... | https://stackoverflow.com/questions/79873144/swiftui-view-state-resetting-after-alert-is-shown | ios, swift, swiftui, ios26 | 1,769,023,318 |
se_70962534 | stackoverflow | MOBILE_DEVELOPMENT | Swift await/async - how to wait synchronously for an async task to complete? | Swift await/async - how to wait synchronously for an async task to complete?
I'm bridging the sync/async worlds in Swift and doing incremental adoption of async/await. I'm trying to invoke an async function that returns a value from a non async function. I understand that explicit use of Task is the way to do that, ... | https://stackoverflow.com/questions/70962534/swift-await-async-how-to-wait-synchronously-for-an-async-task-to-complete | swift, swift-concurrency | 1,643,834,141 |
se_50012567 | stackoverflow | MOBILE_DEVELOPMENT | How to convert Data to AVAsset? | How to convert Data to AVAsset?
Is there a way to convert Data to AVAsset/AVURLAsset or better AVPlayerItem?
I found an answer that converts Data to PHAsset and requires saving it first to the desk.
Is there a better way? | https://stackoverflow.com/questions/50012567/how-to-convert-data-to-avasset | ios, swift, nsdata, avasset, avplayeritem | 1,524,617,440 |
se_79819793 | stackoverflow | MOBILE_DEVELOPMENT | How to get rid of this view artifact from NSHostingView caused by when the SwiftUI view moves? | How to get rid of this view artifact from NSHostingView caused by when the SwiftUI view moves?
I have view and a NSWindow that contains a moving SwiftUI view via NSHostingView (simplified):
struct ContentView: View {
var body: some View {
Button("Show") {
let controller = NSWindowController(win... | https://stackoverflow.com/questions/79819793/how-to-get-rid-of-this-view-artifact-from-nshostingview-caused-by-when-the-swift | swift, swiftui, nswindow, nshostingview | 1,763,109,362 |
se_79879386 | stackoverflow | MOBILE_DEVELOPMENT | StoreKit 2: How do I reliably detect when a subscription has expired or renewed? | StoreKit 2: How do I reliably detect when a subscription has expired or renewed?
I find StoreKit 2 confusing, specifically around detecting subscription expiry and renewal.
My goal is simple: maintain a Boolean that reflects whether the user currently has an active subscription entitlement.
/// Indicates whether the u... | https://stackoverflow.com/questions/79879386/storekit-2-how-do-i-reliably-detect-when-a-subscription-has-expired-or-renewed | swift, in-app-purchase, storekit, storekit2 | 1,769,775,106 |
se_79879212 | stackoverflow | MOBILE_DEVELOPMENT | Why does macOS MultitouchSupport framework crash if MTDeviceStop is called immediately after MTUnregisterContactFrameCallback? | Why does macOS MultitouchSupport framework crash if MTDeviceStop is called immediately after MTUnregisterContactFrameCallback?
I'm using Apple's private MultitouchSupport.framework to receive raw trackpad touch data on macOS. The basic pattern is:
MTDeviceCreateList() / MTDeviceCreateDefault() to get device reference... | https://stackoverflow.com/questions/79879212/why-does-macos-multitouchsupport-framework-crash-if-mtdevicestop-is-called-immed | swift, macos, cocoa, race-condition, core-foundation | 1,769,757,769 |
se_49610925 | stackoverflow | MOBILE_DEVELOPMENT | Posting data to to server using Swift | Posting data to to server using Swift
In swift i have been facing this issue since days and i dont know what error i am commencing here is my viewcontroller.swift
import UIKit
import Foundation
var otp=0
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate,UITextFieldDelegate
,HomeModel... | https://stackoverflow.com/questions/49610925/posting-data-to-to-server-using-swift | ios, swift, xcode, post | 1,522,670,541 |
se_79777078 | stackoverflow | MOBILE_DEVELOPMENT | iOS 26 Custom Keyboard pushed upward for <1 second when switching keyboards | iOS 26 Custom Keyboard pushed upward for <1 second when switching keyboards
I am building a custom iOS keyboard using UIInputViewController with UIStackView for layout.
There is a strange UI glitch when switching keyboards (e.g. to emoji or system keyboard):
The custom keyboard view is suddenly pushed upward
This... | https://stackoverflow.com/questions/79777078/ios-26-custom-keyboard-pushed-upward-for-1-second-when-switching-keyboards | swift, uikit, custom-keyboard | 1,759,024,915 |
se_79822042 | stackoverflow | MOBILE_DEVELOPMENT | Skip button for tvOS with Google IMA SDK Pod | Skip button for tvOS with Google IMA SDK Pod
I am currently working on a tvOS project that uses the following pod: GoogleAds-IMA-tvOS-SDK (version 4.16.0).
I have two specific requirements and would like clarification on their feasibility:
Custom Skip Button Timing:
I would like to display a custom skip button with m... | https://stackoverflow.com/questions/79822042/skip-button-for-tvos-with-google-ima-sdk-pod | swift, ads, tvos, google-ima, imasdk | 1,763,368,459 |
se_79004931 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI List elements not registering onTapGesture after ios 18 upgrade? | SwiftUI List elements not registering onTapGesture after ios 18 upgrade?
I have a list that searches through a nutrition api and displays the search result in a list. Up until upgrading to ios 18, everything worked flawlessly.
Now, when the list is created, sometimes the onTapGesture is recognizes and loads the foodde... | https://stackoverflow.com/questions/79004931/swiftui-list-elements-not-registering-ontapgesture-after-ios-18-upgrade | ios, swift, swiftui, ios18 | 1,726,795,670 |
se_79877829 | stackoverflow | MOBILE_DEVELOPMENT | Tabbar Translucent issue with nested TabView SwiftUI | Tabbar Translucent issue with nested TabView SwiftUI
TabView {
TabView {
ForEach(items) { _ in
List {
ForEach(items) { item in
Button {
addItem()
} label: {
... | https://stackoverflow.com/questions/79877829/tabbar-translucent-issue-with-nested-tabview-swiftui | ios, swift, swiftui, swiftui-tabview | 1,769,595,196 |
se_79877281 | stackoverflow | MOBILE_DEVELOPMENT | Popover tip blocks source view touches | Popover tip blocks source view touches
I have a popoverTip(_:arrowEdge:action:) attached to a Button, like so:
struct ExampleView: View {
let tip = ExampleTip()
var body: some View {
Button {
tip.invalidate(reason: .actionPerformed)
// Other important things to continue
... | https://stackoverflow.com/questions/79877281/popover-tip-blocks-source-view-touches | ios, swift, swiftui, ipados, tipkit | 1,769,529,652 |
se_79835439 | stackoverflow | MOBILE_DEVELOPMENT | Troubleshooting memory leak / retain cycle in Apple's camera app tutorial | Troubleshooting memory leak / retain cycle in Apple's camera app tutorial
I'm following along this camera tutorial from Apple: https://developer.apple.com/tutorials/sample-apps/capturingphotos-camerapreview
I have a DataModel:
final class DataModel: ObservableObject {
let camera = Camera()
@Published v... | https://stackoverflow.com/questions/79835439/troubleshooting-memory-leak-retain-cycle-in-apples-camera-app-tutorial | ios, swift, swiftui, avfoundation, observableobject | 1,764,643,696 |
se_79438259 | stackoverflow | MOBILE_DEVELOPMENT | Xcode 16.2: Generate swift symbols for assets in package and make them public | Xcode 16.2: Generate swift symbols for assets in package and make them public
Currently, starting with Xcode 15, it's possible to create static variables automatically for every asset item in an asset catalog, e.g. color, or image.
For example, I have a color named ColorTestInsidePackage and the package structure look... | https://stackoverflow.com/questions/79438259/xcode-16-2-generate-swift-symbols-for-assets-in-package-and-make-them-public | ios, swift, xcode, assets, asset-catalog | 1,739,502,397 |
se_79876609 | stackoverflow | MOBILE_DEVELOPMENT | SwiftUI List row expansion doesn’t animate smoothly; items below jump abruptly | SwiftUI List row expansion doesn’t animate smoothly; items below jump abruptly
I’m trying to animate a row expansion inside a List when the user taps a note icon. I’m wrapping the state change in withAnimation, but the note appears with a poor animation and the rows below are pushed down without animation (they “jump”... | https://stackoverflow.com/questions/79876609/swiftui-list-row-expansion-doesn-t-animate-smoothly-items-below-jump-abruptly | ios, swift, list, animation, swiftui | 1,769,455,406 |
se_75630110 | stackoverflow | MOBILE_DEVELOPMENT | All Swift BrightFuture callbacks happen on the main thread, right? | All Swift BrightFuture callbacks happen on the main thread, right?
When we make an asynchronous request using BrightFutures.
service.makeSomeRequest(
param1: value1,
param2: value2
)
.onSuccess { [weak self] result in
...
}
.onFailure { [weak self] error in
...
}
Which threading context will the respe... | https://stackoverflow.com/questions/75630110/all-swift-brightfuture-callbacks-happen-on-the-main-thread-right | swift, asynchronous, brightfutures | 1,677,864,107 |
se_79876945 | stackoverflow | MOBILE_DEVELOPMENT | Issue with Custom Tab Bar Showing Default Liquid Glass Selection on iOS 26.2 | Issue with Custom Tab Bar Showing Default Liquid Glass Selection on iOS 26.2
I have implemented a custom tab bar, and it works correctly on iOS 18. However, on iOS 26, the Liquid Glass effect displays the default tab selection, which I need to remove. I have tried multiple approaches, but none have resolved the issue.... | https://stackoverflow.com/questions/79876945/issue-with-custom-tab-bar-showing-default-liquid-glass-selection-on-ios-26-2 | ios, swift, uikit, ios18, ios-26.2 | 1,769,501,276 |
se_79876509 | stackoverflow | MOBILE_DEVELOPMENT | Swift 6 strict concurrency: How to achieve Sendable conformance for a class bridging C callbacks? | Swift 6 strict concurrency: How to achieve Sendable conformance for a class bridging C callbacks?
I'm working on a macOS app that uses Apple's private MultitouchSupport.framework to intercept raw trackpad touch data. The framework uses C-style callbacks that fire on an internal background thread (mt_ThreadedMTEntry). ... | https://stackoverflow.com/questions/79876509/swift-6-strict-concurrency-how-to-achieve-sendable-conformance-for-a-class-brid | swift, macos, thread-safety, grand-central-dispatch, swift-concurrency | 1,769,445,958 |
se_79874309 | stackoverflow | MOBILE_DEVELOPMENT | URL(fileURLWithPath:) resolves tilde (~) as home directory in iOS 26 but not in iOS 18 | URL(fileURLWithPath:) resolves tilde (~) as home directory in iOS 26 but not in iOS 18
I encountered a breaking change in iOS 26 when using URL(fileURLWithPath:) with filenames that start with a tilde (~).
The Problem:
let filename = "~MyFile.txt" ... | https://stackoverflow.com/questions/79874309/urlfileurlwithpath-resolves-tilde-as-home-directory-in-ios-26-but-not-in | swift, nsurl, foundation, ios26 | 1,769,147,518 |
se_79876651 | stackoverflow | MOBILE_DEVELOPMENT | AVAssetWriterInput.PixelBufferReceiver.append hangs indefinitely (suspends and never resumes) | AVAssetWriterInput.PixelBufferReceiver.append hangs indefinitely (suspends and never resumes)
I’ve been struggling with a very frustrating issue using the new iOS 26 Swift Concurrency APIs for video processing. My pipeline reads frames using AVAssetReader, processes them via CIContext (Lanczos upscale), and then appen... | https://stackoverflow.com/questions/79876651/avassetwriterinput-pixelbufferreceiver-append-hangs-indefinitely-suspends-and-n | swift, avfoundation, avassetwriter, ios26, avassetwriterinput | 1,769,460,677 |
se_69575319 | stackoverflow | MOBILE_DEVELOPMENT | Swift pulse animation non circle | Swift pulse animation non circle
I'm trying to create pulse animation rectangular shape
I have code:
func createPulse() {
for _ in 0...3 {
let circularPath = UIBezierPath(arcCenter: .zero, radius: view.bounds.size.height/2, startAngle: 0, endAngle: 2 * .pi, clockwise: true)
let pulseLayer = CAShape... | https://stackoverflow.com/questions/69575319/swift-pulse-animation-non-circle | swift, animation, rectangles | 1,634,234,172 |
se_43085780 | stackoverflow | MOBILE_DEVELOPMENT | mpvolumeview on rotation doesn't take touch properly | mpvolumeview on rotation doesn't take touch properly
I am using a mpvolumeview in vertical position in my app. But now I am not able to slide in slider properly. It only works at the bottom of slider.
My code for adding MPVolumeView:
volumeViewVertical = MPVolumeView(frame: CGRect(x: 60, y: -80, width: 140, height... | https://stackoverflow.com/questions/43085780/mpvolumeview-on-rotation-doesnt-take-touch-properly | ios, swift, uislider, mpvolumeview | 1,490,768,369 |
se_75791321 | stackoverflow | MOBILE_DEVELOPMENT | Task isn't running right after creation in Swift | Task isn't running right after creation in Swift
In the Apple Docs, it says
Tasks can start running immediately after creation; you don’t explicitly start or schedule them.
However, in my code, the Task only starts running when the function that calls it goes out of scope.
func test() {
Task {
print(... | https://stackoverflow.com/questions/75791321/task-isnt-running-right-after-creation-in-swift | ios, swift, concurrency, task | 1,679,321,377 |
se_63095851 | stackoverflow | MOBILE_DEVELOPMENT | Show/Hide Password - How can I add this feature? | Show/Hide Password - How can I add this feature?
I've looked through the forums but I'm seeing mixed answers especially ones from an old Xcode version.
I only decided to add this after already typing up the code I have in this:
How could I go about doing that? I was wanting the 'Eyeball' toggle implemented on the pas... | https://stackoverflow.com/questions/63095851/show-hide-password-how-can-i-add-this-feature | swift, swiftui | 1,595,734,871 |
se_79869235 | stackoverflow | MOBILE_DEVELOPMENT | How to keep Large Title and Toolbar Button on the same line while preserving native button styling? | How to keep Large Title and Toolbar Button on the same line while preserving native button styling?
I am trying to achieve a specific layout in SwiftU. I want a Large Title ("Monthly Overview") and a native-styled action button ("+") to appear on the exact same horizontal line.
Goal:
Large Title: Left-aligned, using ... | https://stackoverflow.com/questions/79869235/how-to-keep-large-title-and-toolbar-button-on-the-same-line-while-preserving-nat | ios, swift, xcode, swiftui, xcode16 | 1,768,554,243 |
se_58837007 | stackoverflow | MOBILE_DEVELOPMENT | Multiple sheet(isPresented:) doesn't work in SwiftUI | Multiple sheet(isPresented:) doesn't work in SwiftUI
I have this ContentView with two different modal views, so I'm using sheet(isPresented:) for both, but as it seems only the last one gets presented. How could I solve this issue? Or is it not possible to use multiple sheets on a view in SwiftUI?
struct ContentVi... | https://stackoverflow.com/questions/58837007/multiple-sheetispresented-doesnt-work-in-swiftui | swift, modal-dialog, swiftui | 1,573,647,598 |
se_79865261 | stackoverflow | MOBILE_DEVELOPMENT | Performance issues in SwiftUI large list with collapsible sections | Performance issues in SwiftUI large list with collapsible sections
Assume we need to display several collapsible sections inside list, each section may contain tens or even hundreds of thousand items.
At first, my naive implementation was something like this:
struct DisplayData: Identifiable {
let id = UUID()
... | https://stackoverflow.com/questions/79865261/performance-issues-in-swiftui-large-list-with-collapsible-sections | swift, performance, swiftui | 1,768,088,561 |
se_79591861 | stackoverflow | MOBILE_DEVELOPMENT | Updating a preview image via @State and @Binding | Updating a preview image via @State and @Binding
I'm a total newbie, just started learning Swift a few days ago and SwiftUI today, so please be gentle :)
Trying to capture images from a camera and show them in a preview. This is for MacOS, not iOS.
struct CameraPreviewView: View {
@Binding var image: CGImage?
... | https://stackoverflow.com/questions/79591861/updating-a-preview-image-via-state-and-binding | swift, swiftui | 1,745,559,230 |
se_79874532 | stackoverflow | MOBILE_DEVELOPMENT | Creating global custom cursor in Swift OS | Creating global custom cursor in Swift OS
I am working on an application where the user can copy to clipboard from the screen, although I am looking for a way to create a custom cursor in macos, for all application.
I have already tried the NSCursor class but that's app specifc [https://developer.apple.com/documentati... | https://stackoverflow.com/questions/79874532/creating-global-custom-cursor-in-swift-os | swift, macos, swiftui | 1,769,170,008 |
se_79872885 | stackoverflow | MOBILE_DEVELOPMENT | How to make a generic specifiable associated type in Swift? | How to make a generic specifiable associated type in Swift?
I'm trying to make a backport for integer generic parameters and a fixed size array that is stored on the stack (backporting InlineArray in short terms):
// Simplified, normally there is a way to get Int from the Num types.
protocol SizeSpecifier {
assoc... | https://stackoverflow.com/questions/79872885/how-to-make-a-generic-specifiable-associated-type-in-swift | swift, generics, associated-types | 1,769,000,583 |
se_75882401 | stackoverflow | MOBILE_DEVELOPMENT | Programmatically click on a menu item | Programmatically click on a menu item
Consider:
var menuList = [
UIAction(title: "title1", handler: { (action: UIAction) in self.myAction(action) }),
UIAction(title: "title2", handler: { (action: UIAction) in self.myAction(action) }),
UIAction(title: "title3", handler: { (action: UIAction) in self.myAction... | https://stackoverflow.com/questions/75882401/programmatically-click-on-a-menu-item | swift, uimenu | 1,680,126,026 |
se_79866037 | stackoverflow | MOBILE_DEVELOPMENT | For a Combine Publisher operator, how can be designed safe for concurrency? | For a Combine Publisher operator, how can be designed safe for concurrency?
An operator takes another Publisher as its upstream source, and a Subscriber as its downstream destination. Let’s say I already have a conversion function from Upstream.Output to Downstream.Input.
Is the producing Upstream/Operator side guaran... | https://stackoverflow.com/questions/79866037/for-a-combine-publisher-operator-how-can-be-designed-safe-for-concurrency | swift, concurrency, publish-subscribe, combine, producer-consumer | 1,768,213,846 |
se_79875400 | stackoverflow | MOBILE_DEVELOPMENT | How to return a rich view/custom view from AppEntity's EntityQuery for Shortcuts app to display? | How to return a rich view/custom view from AppEntity's EntityQuery for Shortcuts app to display?
When I create an AppEntity and have it conform to EntityQuery, a Find AppIntent is created for that entity which can be used in the Shortcuts app. Currently, when this intent is used, it only creates text. However, whe... | https://stackoverflow.com/questions/79875400/how-to-return-a-rich-view-custom-view-from-appentitys-entityquery-for-shortcuts | ios, swift, swiftui, appintents | 1,769,287,792 |
se_79860706 | stackoverflow | MOBILE_DEVELOPMENT | Within a view, problem iterating over dictionary - RandomAccessCollection error | Within a view, problem iterating over dictionary - RandomAccessCollection error
Within body of ContentView I am tring to use ForEach to iterate over a dictionary that is within the instance of a class. The dictionary contains instances of another class.
The compiler reports Generic struct 'ForEach' requires that '[Str... | https://stackoverflow.com/questions/79860706/within-a-view-problem-iterating-over-dictionary-randomaccesscollection-error | swift | 1,767,610,900 |
se_75107634 | stackoverflow | MOBILE_DEVELOPMENT | Indent / pad text in TextEditor | Indent / pad text in TextEditor
I'm using both TextField and TextEditor, as I need single and multi-line text input. I'm targeting iOS 15+, so can't just use TextField with linelimit, as it's iOS 16+.
TextField("placeholder", text: "Hello world")
.padding(10)
TextEditor(text: "Hello world")
.frame(height: 100... | https://stackoverflow.com/questions/75107634/indent-pad-text-in-texteditor | swift, swiftui | 1,673,604,341 |
se_79875266 | stackoverflow | MOBILE_DEVELOPMENT | NSTableViewDiffableDataSource bug? table view delegate method not called | NSTableViewDiffableDataSource bug? table view delegate method not called
The problem is that when I use a diffable data source, the delegate method tableView(_:rowViewForRow:) is not being called.
It will be easiest to show the problem if I just display the complete code for a view controller with a table view propert... | https://stackoverflow.com/questions/79875266/nstableviewdiffabledatasource-bug-table-view-delegate-method-not-called | swift, macos, nstableview, diffabledatasource | 1,769,270,650 |
se_54497079 | stackoverflow | MOBILE_DEVELOPMENT | How does observer.onComplete() works without onNext in chain of flatmap? - does it have to skip all the following flatmaps? | How does observer.onComplete() works without onNext in chain of flatmap? - does it have to skip all the following flatmaps?
See the following code snippet:
class ViewController: UIViewController {
let disposeBag = DisposeBag()
@IBOutlet weak var clickMe: UIButton!
override func viewDidLoad() {
supe... | https://stackoverflow.com/questions/54497079/how-does-observer-oncomplete-works-without-onnext-in-chain-of-flatmap-does | ios, swift, reactive-programming, rx-swift | 1,549,138,366 |
se_78094943 | stackoverflow | MOBILE_DEVELOPMENT | Swift device orientation updating incorrectly | Swift device orientation updating incorrectly
I want to detect device orientation in Swift so that I can apply the correct orientation to a video. The code I have for updating device orientation works correctly but is extremely sensitive to tiny movements. Holding the device upward and barely tilting it causes the dev... | https://stackoverflow.com/questions/78094943/swift-device-orientation-updating-incorrectly | ios, swift, swiftui | 1,709,433,654 |
se_73732020 | stackoverflow | MOBILE_DEVELOPMENT | Scale View to Fit Superview (SwiftUI) | Scale View to Fit Superview (SwiftUI)
I have a CustomView and it's frame needs to be 2000w x 2000h. I want to put this view in a VStack along with other Views. The problem is that, obviously, my CustomView is 2000x2000 which of course does not correctly fit on iPhones. I want this view to scale to fit in the VStack. I... | https://stackoverflow.com/questions/73732020/scale-view-to-fit-superview-swiftui | swift, swiftui, scale, vstack | 1,663,248,509 |
se_75699567 | stackoverflow | MOBILE_DEVELOPMENT | Tasks always seem to run in order in Swift code | Tasks always seem to run in order in Swift code
This code always seems to work like magic. Without any locking, the output is 1,2.
class Counter {
var count = 0
func increment() -> Int {
count += 1
return count
}
}
class ViewController: UIViewController {
var tasks = [Task<Void, N... | https://stackoverflow.com/questions/75699567/tasks-always-seem-to-run-in-order-in-swift-code | swift, swift-concurrency | 1,678,471,201 |
se_28973041 | stackoverflow | MOBILE_DEVELOPMENT | Swift tableView view height equal to amount of cells | Swift tableView view height equal to amount of cells
I have a UItableView that I want the 'view' height to change, based on the amount of cells (data) it has in it. I'm not talking about the cell heights, but the entire table itself. Is there a way to assign the height based on the amount of rows are in the table fr... | https://stackoverflow.com/questions/28973041/swift-tableview-view-height-equal-to-amount-of-cells | xcode, uitableview, swift, height | 1,426,017,701 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.