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_39588311
stackoverflow
MOBILE_DEVELOPMENT
Swift 3. NSFetchRequest propertiesToFetch
Swift 3. NSFetchRequest propertiesToFetch In Swift 3 when we use NSFetchRequest, we have to specify NSFetchRequestResult. But how to get an array of properties values? If I use something like this let fetchRequest = NSFetchRequest<MyClass>(entityName: "MyClass") fetchRequest.propertiesToFetch = ["myAttributeName"] ...
https://stackoverflow.com/questions/39588311/swift-3-nsfetchrequest-propertiestofetch
ios, swift, core-data, swift3, nsfetchrequest
1,474,357,091
se_79963215
stackoverflow
MOBILE_DEVELOPMENT
How to match the width of sheets in swiftUI to match the background?
How to match the width of sheets in swiftUI to match the background? I am calling the apple sheet api but in the current implementation i am getting the padding around the sheet as its the ios26 design but i dont want it. how can we remove this Required Implementation current Implementation .sheet(item: $coordinator...
https://stackoverflow.com/questions/79963215/how-to-match-the-width-of-sheets-in-swiftui-to-match-the-background
ios, swift, swiftui
1,781,878,795
se_79950634
stackoverflow
MOBILE_DEVELOPMENT
What replaces GKGameCenterControllerDelegate on iOS 26?
What replaces GKGameCenterControllerDelegate on iOS 26? When presenting the leaderboard, I provide the gameCenterDelegate: https://developer.apple.com/documentation/gamekit/gkgamecenterviewcontroller/gamecenterdelegate weak var gameCenterDelegate: (any GKGameCenterControllerDelegate)? { get set } This property is not...
https://stackoverflow.com/questions/79950634/what-replaces-gkgamecentercontrollerdelegate-on-ios-26
ios, swift
1,780,465,316
se_79960830
stackoverflow
MOBILE_DEVELOPMENT
How can I apply focus styling to an entire search view when the TextField is focused?
How can I apply focus styling to an entire search view when the TextField is focused? I'm currently adding macOS and visionOS support to my SignDict. Everything looks perfect on iPadOS, but I'm seeing an issue on macOS. I have a custom search view in the SwiftUI with a ToolbarItem: ToolbarItem { HStack(spacing: 5)...
https://stackoverflow.com/questions/79960830/how-can-i-apply-focus-styling-to-an-entire-search-view-when-the-textfield-is-foc
swift, macos, swiftui
1,781,635,429
se_79960863
stackoverflow
MOBILE_DEVELOPMENT
Quirk to using Swift Sets with Hashable objects
Quirk to using Swift Sets with Hashable objects I wanted to use a Set to track objects that contained a unique key value but variable data. The docs on Set say the objects you store in it must conform to Hashable. However, if you create an object that conforms to Hashable and returns the same hash if the keys are the ...
https://stackoverflow.com/questions/79960863/quirk-to-using-swift-sets-with-hashable-objects
swift, set
1,781,640,367
se_79960644
stackoverflow
MOBILE_DEVELOPMENT
iOS 26/27 SwiftUI — how to get the “search as a tab” morph (tabs collapse left + search field at the bottom) with a separated search tab?
iOS 26/27 SwiftUI — how to get the “search as a tab” morph (tabs collapse left + search field at the bottom) with a separated search tab? I'm building a SwiftUI app on Xcode 26/27 (beta), targeting iOS 26 / iOS 27, and I want the exact “search as a tab” behavior that Apple's own apps use (Phone, News, Health, Music): ...
https://stackoverflow.com/questions/79960644/ios-26-27-swiftui-how-to-get-the-search-as-a-tab-morph-tabs-collapse-left
ios, swift, xcode, swiftui
1,781,613,938
se_79856523
stackoverflow
MOBILE_DEVELOPMENT
Capture of &#39;objectIDNotifications&#39; with non-Sendable type &#39;[Notification]&#39; in a &#39;@Sendable&#39; closure
Capture of &#39;objectIDNotifications&#39; with non-Sendable type &#39;[Notification]&#39; in a &#39;@Sendable&#39; closure I'm using Swift5 and SwiftUI making an app that based on CloudKit. I've made the merge data from iCloud function and it looks work well. But I always get a warning like "Capture of 'objectIDNotif...
https://stackoverflow.com/questions/79856523/capture-of-objectidnotifications-with-non-sendable-type-notification-in-a
ios, swift, cloudkit
1,766,978,240
se_79960461
stackoverflow
MOBILE_DEVELOPMENT
Xcode debugger freezes with &quot;error: memory read failed for 0x0&quot; on iOS 27 and tvOS 27 devices
Xcode debugger freezes with &quot;error: memory read failed for 0x0&quot; on iOS 27 and tvOS 27 devices I'm experiencing an issue when debugging my app on a physical device running iOS 27 (also reproducible on tvOS 27). The app itself runs correctly, but Xcode gets stuck during debugging. The Project Navigator highlig...
https://stackoverflow.com/questions/79960461/xcode-debugger-freezes-with-error-memory-read-failed-for-0x0-on-ios-27-and-tv
ios, swift, xcode
1,781,588,891
se_31408962
stackoverflow
MOBILE_DEVELOPMENT
Segue From UIScrollView to Other View In Swift
Segue From UIScrollView to Other View In Swift I am making an image gallery in swift with XCode. The gallery is like this: (see bottom of the post) I do this with a view called item that has the image view and the title (xib+ControlView) inserted in a horizontal view, and this view inserted in the scroll view. I need ...
https://stackoverflow.com/questions/31408962/segue-from-uiscrollview-to-other-view-in-swift
ios, iphone, swift, uiscrollview, segue
1,436,882,659
se_73317282
stackoverflow
MOBILE_DEVELOPMENT
How to fetch the events from local calendar in iOS swift
How to fetch the events from local calendar in iOS swift I'm trying to fetch events from the device's local calendar using EventKit in Swift. I have already saved multiple events in my local calendar, but when I try to retrieve them, the events array is always empty. func fetchEvent() { let store = EKEventStore()...
https://stackoverflow.com/questions/73317282/how-to-fetch-the-events-from-local-calendar-in-ios-swift
ios, swift, ekeventkit
1,660,205,136
se_79841906
stackoverflow
MOBILE_DEVELOPMENT
How to automatically operate SwiftUI TabView / TabBar when running UI XCTestCase
How to automatically operate SwiftUI TabView / TabBar when running UI XCTestCase I am trying to run an and operate my app automatically using a UI XCTestCase. While operating buttons and other controls by addressing them with their accessibilityIdentifier I struggle to do the same with a TabView and its pages / tab ba...
https://stackoverflow.com/questions/79841906/how-to-automatically-operate-swiftui-tabview-tabbar-when-running-ui-xctestcase
ios, swift, xcode, swiftui
1,765,282,378
se_40554363
stackoverflow
MOBILE_DEVELOPMENT
How to open Safari Extension ToolbarItem popover programmatically
How to open Safari Extension ToolbarItem popover programmatically I want to programmatically trigger a 'click' event on my Safari Extension toolbarItem so that my custom popover appears after something happens on the webpage. I'm using the new Xcode extension IDE and have built my popover using interface builder. All ...
https://stackoverflow.com/questions/40554363/how-to-open-safari-extension-toolbaritem-popover-programmatically
swift, xcode, cocoa, safari-extension
1,478,890,242
se_79957357
stackoverflow
MOBILE_DEVELOPMENT
Swift package is not loading and giving dyld[11588]: Library not loaded: @rpath/libinference_engine.dylib error
Swift package is not loading and giving dyld[11588]: Library not loaded: @rpath/libinference_engine.dylib error I am trying to use LeapSDK iOS Swift SDK to run leap on device models. My app is building but upon running it is giving the following errors: Library not loaded: @rpath/libinference_engine.dylib Referenced...
https://stackoverflow.com/questions/79957357/swift-package-is-not-loading-and-giving-dyld11588-library-not-loaded-rpath
ios, swift, xcode, swiftui
1,781,311,501
se_60029546
stackoverflow
MOBILE_DEVELOPMENT
Renders LaTeX code in UILabel/UITextfield natively on iOS
Renders LaTeX code in UILabel/UITextfield natively on iOS I want to render LaTeX in my application. I have tried iOSMath and iOSLatex. The problem is iOS Math does not support latex with text while iOS Latex renders latex on a WkWebview and the takes screenshot of it and return an image. Do we have a native renderer...
https://stackoverflow.com/questions/60029546/renders-latex-code-in-uilabel-uitextfield-natively-on-ios
ios, swift, latex
1,580,670,194
se_77794933
stackoverflow
MOBILE_DEVELOPMENT
@Bindable usage with protocols
@Bindable usage with protocols Prior to iOS 17, I was used to creating SwiftUI views with a generic approach where a view is constrainted to one view model, and that ViewModel can be a protocol. This was very nice for testing and wrapping all the UI-related things to the ViewModels interface. @MainActor protocol CityQ...
https://stackoverflow.com/questions/77794933/bindable-usage-with-protocols
swift, swiftui, observable, ios17
1,704,904,338
se_79570447
stackoverflow
MOBILE_DEVELOPMENT
Understanding Task{ } behaviour in iOS Swift Concurrency
Understanding Task{ } behaviour in iOS Swift Concurrency func someTask() { let _="" Task{ let _="" let data=await doBackgroundTask() let _=data // Update UI with data } } func doBackgroundTask() async->String{ // Heavy work here return "" } Steps someTask() is invoked fr...
https://stackoverflow.com/questions/79570447/understanding-task-behaviour-in-ios-swift-concurrency
swift, swift-concurrency
1,744,460,674
se_31443645
stackoverflow
MOBILE_DEVELOPMENT
Simplest way to throw an error/exception with a custom message in Swift?
Simplest way to throw an error/exception with a custom message in Swift? I want to do something in Swift that I'm used to doing in multiple other languages: throw a runtime exception with a custom message. For example (in Java): throw new RuntimeException("A custom message here") I understand that I can throw enum ...
https://stackoverflow.com/questions/31443645/simplest-way-to-throw-an-error-exception-with-a-custom-message-in-swift
ios, swift
1,437,007,803
se_37811148
stackoverflow
MOBILE_DEVELOPMENT
Comparison of String to a CString in the Swift does not work
Comparison of String to a CString in the Swift does not work I'm trying to check if column exists or not in the sqlite db using Swift. The "MyTable" has 3 columns "Name","Age","Class". I need to check if column "Service" exists or not. Below is code to do so : var columnExists = 0 var db: COpaquePointer = nil var outp...
https://stackoverflow.com/questions/37811148/comparison-of-string-to-a-cstring-in-the-swift-does-not-work
ios, swift, string, c-strings
1,465,904,872
se_52425565
stackoverflow
MOBILE_DEVELOPMENT
Why is the Locksmith library not updating data based on my variable?
Why is the Locksmith library not updating data based on my variable? I am trying to update a game score in the Keychain using the Swift library Locksmith. In my Initial ViewController viewDidLoad() I have this code to initially set the value to: 0 do { try Locksmith.saveData(data:["score" : 0], forUserAccount: "so...
https://stackoverflow.com/questions/52425565/why-is-the-locksmith-library-not-updating-data-based-on-my-variable
swift, keychain
1,537,447,769
se_79955881
stackoverflow
MOBILE_DEVELOPMENT
Replicating the iOS 26 Tab Bar: Components, Animations, and Dimensions
Replicating the iOS 26 Tab Bar: Components, Animations, and Dimensions Could you please share the code for a tab bar similar to the one in iOS26 photos app, including the same elements, visual effects (liquid glass etc), animations, colors and exact dimensions/layout? I tried many times, but each time something breaks...
https://stackoverflow.com/questions/79955881/replicating-the-ios-26-tab-bar-components-animations-and-dimensions
ios, swift, swiftui, tabs
1,781,072,296
se_79951312
stackoverflow
MOBILE_DEVELOPMENT
SwiftData model not saving after first save
SwiftData model not saving after first save I'm working on a SwiftData document-based app that stores an AttributedString using the boilerplate from Apple's demo app from WWDC to store the AttributedString data, included below. What's weird is that after the first save, the AttributedStringModel only saves changes to ...
https://stackoverflow.com/questions/79951312/swiftdata-model-not-saving-after-first-save
swift, swiftdata
1,780,567,118
se_31540446
stackoverflow
MOBILE_DEVELOPMENT
How to silence a warning in Swift?
How to silence a warning in Swift? I have a piece of code which is generating lots of warnings (deprecated API) Using clang* I could do: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" ... #pragma clang diagnostic pop However this does not work in Swift. How to do it in ...
https://stackoverflow.com/questions/31540446/how-to-silence-a-warning-in-swift
swift, pragma
1,437,485,274
se_77664511
stackoverflow
MOBILE_DEVELOPMENT
How to change navigation title color in swiftUI?
How to change navigation title color in swiftUI? How to change navigation title color in swiftUI Hi, There I am learning SwiftUI, I want change navigation Title Color. I have set navigation Title using .navigationTitle("Parent Login") I have tried to color of navigation title using below code. struct ContentView: View...
https://stackoverflow.com/questions/77664511/how-to-change-navigation-title-color-in-swiftui
swift, swiftui
1,702,620,280
se_79954395
stackoverflow
MOBILE_DEVELOPMENT
Unable to call Swift extension method from .m Objective C file - No visible @interface
Unable to call Swift extension method from .m Objective C file - No visible @interface I have an Objective C class with the .m and .h files respectively. I created a Swift file which has a function but I am unable to call it despite me declaring the function in the .h and importing the bridging header (I think) My Loc...
https://stackoverflow.com/questions/79954395/unable-to-call-swift-extension-method-from-m-objective-c-file-no-visible-int
swift, objective-c
1,780,989,201
se_79954592
stackoverflow
MOBILE_DEVELOPMENT
Big Nerd Ranch iOS Programming Resources File?
Big Nerd Ranch iOS Programming Resources File? I have been following along the Big Nerd Ranch iOS programming textbook, and so far have gotten along without the resources file. For Chapter 17 it would be very useful, but since they (?) went out of business, the website with the zip is not available. Does anyone have i...
https://stackoverflow.com/questions/79954592/big-nerd-ranch-ios-programming-resources-file
ios, swift
1,781,010,668
se_69214543
stackoverflow
MOBILE_DEVELOPMENT
How can I add caching to AsyncImage
How can I add caching to AsyncImage I'm new to SwiftUI and was looking how to download images from a URL. I've found out that in iOS15 you can use AsyncImage to handle all the phases of an Image. The code looks like this. AsyncImage(url: URL(string: urlString)) { phase in switch phase { case .succe...
https://stackoverflow.com/questions/69214543/how-can-i-add-caching-to-asyncimage
swift, swiftui
1,631,822,725
se_79948410
stackoverflow
MOBILE_DEVELOPMENT
onChange(of:) is not getting triggered
onChange(of:) is not getting triggered Why does onChange(of: authManager.authState) in View1 not fire when I change authState in View2? struct View1: View { @Environment(AuthManager.self) var authManager var body: some View { NavigationStack { VStack { Text("\(authManager.authState)") } ...
https://stackoverflow.com/questions/79948410/onchangeof-is-not-getting-triggered
swift, swiftui, onchange
1,780,051,812
se_72559878
stackoverflow
MOBILE_DEVELOPMENT
FIrebase for iOS not logging custom events
FIrebase for iOS not logging custom events Recently I have added Firebase to my project to add event tracking. The problem is that I can not log custom events. I have enabled Analytics at firebase I have added the GoogleService-Info file I have enabled Firebase debug flag for my scheme I have implemented a class to e...
https://stackoverflow.com/questions/72559878/firebase-for-ios-not-logging-custom-events
ios, swift, firebase, google-analytics, firebase-analytics
1,654,776,031
se_79952567
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI Text alignment next to centred Text
SwiftUI Text alignment next to centred Text I have the following view featuring two lines of text: VStack { Text("first line of text") .font(.callout) Text("100") .font(.largeTitle) .bold() } Now these two lines of text are centred one on top of the other and the second one features a ...
https://stackoverflow.com/questions/79952567/swiftui-text-alignment-next-to-centred-text
swift, swiftui, swiftui-text
1,780,816,313
se_79952514
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI Map View freezes when there is no network
SwiftUI Map View freezes when there is no network Map View in SwiftUI freezes, or stops receiving touch events when there is no internet connection. Any interaction, like zoom, pan and rotate stops working, but the map itself seems to be working, as if for example I can add a MapPolyline and update it, but the map is ...
https://stackoverflow.com/questions/79952514/swiftui-map-view-freezes-when-there-is-no-network
ios, swift, swiftui, mapkit, offline
1,780,794,733
se_76365552
stackoverflow
MOBILE_DEVELOPMENT
Removing title bar (including traffic lights and title) in a SwiftUI desktop application
Removing title bar (including traffic lights and title) in a SwiftUI desktop application I'm currently developing a SwiftUI desktop application and I'm facing an issue with window customization. I want to entirely remove the title bar from my application's window - this includes the traffic lights (close, minimize, ma...
https://stackoverflow.com/questions/76365552/removing-title-bar-including-traffic-lights-and-title-in-a-swiftui-desktop-app
swift, macos, swiftui, nswindow
1,685,454,625
se_67505799
stackoverflow
MOBILE_DEVELOPMENT
UIContextualAction display UIMenu
UIContextualAction display UIMenu I've noted that in the Facebook Messenger they display the UIMenu when someone presses the UIContextualAction. I might be missing something, but I don't see how to do it. If someone knows the code to do this, I would highly appreciate it.
https://stackoverflow.com/questions/67505799/uicontextualaction-display-uimenu
ios, swift, xcode, uikit
1,620,830,305
se_29831587
stackoverflow
MOBILE_DEVELOPMENT
Swift, could not cast value of type
Swift, could not cast value of type I created a subclass of UICollectionViewController and called it LibraryCollectionViewController, and marked both checkboxes for the project and test. Also its storyboard id is LibraryCollectionViewController and I set its corresponding class in Interface Builder. Being new to Swift...
https://stackoverflow.com/questions/29831587/swift-could-not-cast-value-of-type
ios, swift
1,429,813,769
se_72303300
stackoverflow
MOBILE_DEVELOPMENT
MacOS Toolbar Space makes Items disappear despite sufficient space
MacOS Toolbar Space makes Items disappear despite sufficient space I created a macOS App with a NavigationView and a Toolbar. Somehow next to my toolbarItem there is a lot of space.. So whenever I change the size of my apps window the toolbarItem disappears. Despite there is still a lot of space for my item. I did not...
https://stackoverflow.com/questions/72303300/macos-toolbar-space-makes-items-disappear-despite-sufficient-space
swift, macos, toolbar, swiftui-navigationview
1,652,957,801
se_79951614
stackoverflow
MOBILE_DEVELOPMENT
Swift - MacOS - Audio input timestamp overlaps or precedes prior audio input
Swift - MacOS - Audio input timestamp overlaps or precedes prior audio input I am getting an error that I am not able to see any resource around the internet for. I tried a lot of different things but none are able to resolve this issue: Audio input timestamp overlaps or precedes prior audio input Context: I was playi...
https://stackoverflow.com/questions/79951614/swift-macos-audio-input-timestamp-overlaps-or-precedes-prior-audio-input
ios, swift, macos, audio, speech
1,780,610,507
se_79947936
stackoverflow
MOBILE_DEVELOPMENT
Using @IBSegueAction with NSSplitViewController in storyboard-based AppKit app
Using @IBSegueAction with NSSplitViewController in storyboard-based AppKit app I have a storyboard-based AppKit app and I am trying to inject dependencies into an NSSplitViewController and its child NSViewControllers using either: @IBSegueAction instantiateInitialController(creator:) The hierarchy is: NSWindowCont...
https://stackoverflow.com/questions/79947936/using-ibsegueaction-with-nssplitviewcontroller-in-storyboard-based-appkit-app
swift, segue, appkit, xcode-storyboard, ibsegueaction
1,779,978,333
se_79947986
stackoverflow
MOBILE_DEVELOPMENT
Having trouble iterating over a set of selected items in a List
Having trouble iterating over a set of selected items in a List In SwiftUI I have declared a List of courses. I want to be able to select multiple courses in order to perform some operation. I have declared a Course struct: struct Course: Identifiable, Hashable { let id = UUID() // Generates a unique ID automatica...
https://stackoverflow.com/questions/79947986/having-trouble-iterating-over-a-set-of-selected-items-in-a-list
swift, swiftui
1,779,985,660
se_55428968
stackoverflow
MOBILE_DEVELOPMENT
How to fix &#39;-[NWConcrete_nw_association redactedDescription]&#39; crash in iOS
How to fix &#39;-[NWConcrete_nw_association redactedDescription]&#39; crash in iOS I am trying to fix a bug that I am not able to recreate.It's random. I've tried many ways, but this bug is still here.what should i do? Can anybody help me how can i fix this my issue. This is the full stack trace.It's too long. From th...
https://stackoverflow.com/questions/55428968/how-to-fix-nwconcrete-nw-association-redacteddescription-crash-in-ios
ios, swift, crash-reports
1,553,928,815
se_79951157
stackoverflow
MOBILE_DEVELOPMENT
How to add a dependency to a local package
How to add a dependency to a local package I'm working on a SwiftUI iOS app with a watchOS companion app that uses a local common package for shared data, services, and utilities. I've kept it pretty self-reliant throughout development, but one of the hard requirements is that it reports logs and errors to Sentry so I...
https://stackoverflow.com/questions/79951157/how-to-add-a-dependency-to-a-local-package
swift, xcode, swiftui, swift-package-manager
1,780,540,871
se_42386015
stackoverflow
MOBILE_DEVELOPMENT
How to get same function name in swift from #function and #selector
How to get same function name in swift from #function and #selector My code: override func viewDidLoad() { super.viewDidLoad() print("1 \(#function))") let selector = #selector(UIViewController.viewDidLoad) print("2 \(NSStringFromSelector(selector))") } The log output: 1 viewDidLoad() 2 viewDidLoad I...
https://stackoverflow.com/questions/42386015/how-to-get-same-function-name-in-swift-from-function-and-selector
swift, function, selector
1,487,751,379
se_59114392
stackoverflow
MOBILE_DEVELOPMENT
what does #function mean here in this function any ideas?
what does #function mean here in this function any ideas? func viewController<T : UIViewController>(viewControllerClass : T.Type, function : String = #function, line : Int = #line, file : String = #file) -> T { } what is the meaning of function here any ideas???
https://stackoverflow.com/questions/59114392/what-does-function-mean-here-in-this-function-any-ideas
swift
1,575,101,312
se_79950608
stackoverflow
MOBILE_DEVELOPMENT
RealityKit sending mesh descriptors risks causing data races
RealityKit sending mesh descriptors risks causing data races I have this function to transform a given mesh and return the transformed mesh. extension MeshResource { func transformedMesh() async -> MeshResource { var allDescriptors: [MeshDescriptor] = [] for model in self.contents.models { for par...
https://stackoverflow.com/questions/79950608/realitykit-sending-mesh-descriptors-risks-causing-data-races
ios, swift, concurrency
1,780,461,207
se_79950396
stackoverflow
MOBILE_DEVELOPMENT
.focusedSceneValue Defined as Function Causes Window-Resizing Menu Commands to Disappear
.focusedSceneValue Defined as Function Causes Window-Resizing Menu Commands to Disappear I have a ContentView View that is a Rectangle whose fill color changes on timer every few seconds. The fill color can also be changed via a menu command. There is Text that can be displayed on top of the Rectangle. The text can be...
https://stackoverflow.com/questions/79950396/focusedscenevalue-defined-as-function-causes-window-resizing-menu-commands-to-d
swift, swiftui, swiftui-menu
1,780,420,198
se_79950602
stackoverflow
MOBILE_DEVELOPMENT
is RealityKit&#39;s postProcess renderCallback supposed to be @Sendable?
is RealityKit&#39;s postProcess renderCallback supposed to be @Sendable? The current API seems to indicate that the closure is non-isolated: https://developer.apple.com/documentation/realitykit/arview/rendercallbacks-swift.struct/postprocess // this happens in main self.renderCallbacks.postProcess = { cont...
https://stackoverflow.com/questions/79950602/is-realitykits-postprocess-rendercallback-supposed-to-be-sendable
ios, swift, concurrency
1,780,459,512
se_79950546
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI UIViewRepresentable SecureField dots invisible in dark mode only when iOS autofills a strong password
SwiftUI UIViewRepresentable SecureField dots invisible in dark mode only when iOS autofills a strong password have a custom SecureField built with UIViewRepresentable wrapping UITextField. When the user types their own password, the dots are visible in both light and dark mode. However, when iOS suggests and autofills...
https://stackoverflow.com/questions/79950546/swiftui-uiviewrepresentable-securefield-dots-invisible-in-dark-mode-only-when-io
swift, ios-darkmode
1,780,439,797
se_79950504
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI: AttributedString Localization does not seem to work
SwiftUI: AttributedString Localization does not seem to work I have this test code import SwiftUI struct TestAppleSuggestion: View { @Environment(\.locale) var locale: Locale var body: some View { VStack { VStack { Text("locale: \(locale.identifier)") ...
https://stackoverflow.com/questions/79950504/swiftui-attributedstring-localization-does-not-seem-to-work
swift, swiftui
1,780,432,976
se_79949855
stackoverflow
MOBILE_DEVELOPMENT
Best way to store an array of integers in Core Data when querying is not required?
Best way to store an array of integers in Core Data when querying is not required? I’m persisting data from a remote API into Core Data. One of the properties returned by the API is an array of integers with an arbitrary length, for example: [1, 2, 3, 4, ...] The values are only used for persistence and retrieval. I ...
https://stackoverflow.com/questions/79949855/best-way-to-store-an-array-of-integers-in-core-data-when-querying-is-not-require
swift, core-data, cloudkit
1,780,339,125
se_65100459
stackoverflow
MOBILE_DEVELOPMENT
How should I go about rendering text in Metal?
How should I go about rendering text in Metal? I only need to render 2 dimensional text, but the examples (Text Rendering by MetalByExample.com) I found are in Objective-C, very messy, and probably have a lot of muck (code or steps that aren't necessary for full functionality). How should I go about rendering simple t...
https://stackoverflow.com/questions/65100459/how-should-i-go-about-rendering-text-in-metal
swift, text, rendering, metal
1,606,868,096
se_61024322
stackoverflow
MOBILE_DEVELOPMENT
Draw simple text with metal
Draw simple text with metal In our app, we used metal to draw heart rate graph and it works fine, but now I want to draw a simple text with metal. Since I wasn't part of the team when they implemented metal calculation. I have a few questions: 1- In the metal view encoder, should I use line drawPrimitives type ? I ...
https://stackoverflow.com/questions/61024322/draw-simple-text-with-metal
swift, metal, metalkit
1,585,979,737
se_79950027
stackoverflow
MOBILE_DEVELOPMENT
I&#39;m building a screen time app using FamilyControls and DeviceActivity
I&#39;m building a screen time app using FamilyControls and DeviceActivity I'm building a screen time app using FamilyControls and DeviceActivity. The monitoring starts successfully but eventDidReachThreshold never fires. ## Setup - iOS 26.5 beta - FamilyControls Distribution entitlement approved - App Group: group....
https://stackoverflow.com/questions/79950027/im-building-a-screen-time-app-using-familycontrols-and-deviceactivity
ios, swift
1,780,378,565
se_37346187
stackoverflow
MOBILE_DEVELOPMENT
Create an &quot;add-player&quot; view - Swift
Create an &quot;add-player&quot; view - Swift I'm creating a game where the player has the possibility to add several players on a view controller : Actually, I can add a new player and remove it : The problem appears when I remove a player : I want player 2 and player 3 goes below the textField "Name when I ...
https://stackoverflow.com/questions/37346187/create-an-add-player-view-swift
ios, swift, textfield
1,463,745,548
se_76775044
stackoverflow
MOBILE_DEVELOPMENT
Is timeStyle.long and .full broken, or have I done something wrong?
Is timeStyle.long and .full broken, or have I done something wrong? I am making an app in swift using Swift UI which uses several different date to string functions and they all seem to work ok for all the locales I've checked besides this one. This works for my home locale of "en_uk" but when I change the schema to b...
https://stackoverflow.com/questions/76775044/is-timestyle-long-and-full-broken-or-have-i-done-something-wrong
swift, date, locale, date-formatting, chinese-locale
1,690,405,591
se_79949880
stackoverflow
MOBILE_DEVELOPMENT
macOS 26: keep a captured window&#39;s content live while it&#39;s on an inactive Space (ScreenCaptureKit returns blank frames for video)
macOS 26: keep a captured window&#39;s content live while it&#39;s on an inactive Space (ScreenCaptureKit returns blank frames for video) I have a macOS menu-bar app (Swift, macOS 26.5, Apple Silicon, SIP enabled) that "pins" a live thumbnail of another app's window in a small floating NSPanel. The panel uses collecti...
https://stackoverflow.com/questions/79949880/macos-26-keep-a-captured-windows-content-live-while-its-on-an-inactive-space
swift, macos, avfoundation, core-graphics, screencapturekit
1,780,343,258
se_79844036
stackoverflow
MOBILE_DEVELOPMENT
How to programatically detect installed web browsers on macOS
How to programatically detect installed web browsers on macOS Historically, I remember that detecting installed web browsers on macOS was somewhat error prone. You can ask macOS for the apps which register themselves as handlers for HTTPS, but that can show too much because there are apps like iTerm2 and BetterTouchTo...
https://stackoverflow.com/questions/79844036/how-to-programatically-detect-installed-web-browsers-on-macos
swift, objective-c, macos
1,765,462,256
se_42878312
stackoverflow
MOBILE_DEVELOPMENT
How to compare UIColors in Swift
How to compare UIColors in Swift I'm trying to compare different colors in Swift. Everything is fine till i re-build the app. Same colors, same code, but it doesn't work. I'm adding background color to a text, and I have different themes. When users change the theme the app should also change the background color for...
https://stackoverflow.com/questions/42878312/how-to-compare-uicolors-in-swift
swift, colors, compare, equality
1,489,862,052
se_79949438
stackoverflow
MOBILE_DEVELOPMENT
Unexpected behavior in protocol inheritance
Unexpected behavior in protocol inheritance I use main actor by default in project settings, and use Swift 6 mode. Here's the code: public protocol Main {} nonisolated public protocol NonIso {} // Foo is on main // As proven by the compilation failure in `testNonIso()` public protocol Foo: NonIso, Main { func foo()...
https://stackoverflow.com/questions/79949438/unexpected-behavior-in-protocol-inheritance
ios, swift, concurrency
1,780,267,251
se_79948820
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI Slider spams sensory feedback
SwiftUI Slider spams sensory feedback I am trying to implement a SwiftUI Slider with steps, but I am running into an issue with sensory feedback being triggered repeatedly when the slider reaches either end. This also happens with Apple’s own example from the official documentation: https://developer.apple.com/documen...
https://stackoverflow.com/questions/79948820/swiftui-slider-spams-sensory-feedback
ios, swift, swiftui, slider
1,780,128,519
se_79948720
stackoverflow
MOBILE_DEVELOPMENT
OSSignposter cannot be enabled on WatchOS, but is fine on IOS, what am I missing?
OSSignposter cannot be enabled on WatchOS, but is fine on IOS, what am I missing? I’m trying to use OSSignposter signposts in a watchOS app and view them in Instruments, but signposter.isEnabled is always false on the Apple Watch. I have a paired physical iPhone + physical Apple Watch. The Watch app runs successfully ...
https://stackoverflow.com/questions/79948720/ossignposter-cannot-be-enabled-on-watchos-but-is-fine-on-ios-what-am-i-missing
ios, swift, watchos, xcode-instruments
1,780,098,020
se_78310754
stackoverflow
MOBILE_DEVELOPMENT
I&#39;m encountering an error with my POST API request: &#39;Error parsing JSON&#39;
I&#39;m encountering an error with my POST API request: &#39;Error parsing JSON&#39; I'm new to SwiftUI and having trouble posting an API request, I have checked everything but still getting 500 server error message. I'm stuck on this - please help if possible. Response data: <!doctype html> <html lang="en"> <head> ...
https://stackoverflow.com/questions/78310754/im-encountering-an-error-with-my-post-api-request-error-parsing-json
ios, json, swift
1,712,842,656
se_78314605
stackoverflow
MOBILE_DEVELOPMENT
How to add multiple fields in headers of a post api request
How to add multiple fields in headers of a post api request I'm new to SwiftUI and having trouble in sending a post API request, I want to add "User-Agent" field to my headers like this: {"headers": {"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/...
https://stackoverflow.com/questions/78314605/how-to-add-multiple-fields-in-headers-of-a-post-api-request
ios, swift, mobile-development
1,712,904,512
se_79780213
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI ViewModifier should accept theme explicitly or read it from environment — why does any protocol fail?
SwiftUI ViewModifier should accept theme explicitly or read it from environment — why does any protocol fail? I have created a protocol base theme system I use within my app. While this works fine in general, I came across a problem when trying to create a ViewModifier which accepts a theme parameter and applies its v...
https://stackoverflow.com/questions/79780213/swiftui-viewmodifier-should-accept-theme-explicitly-or-read-it-from-environment
ios, swift, swiftui, swift-protocols
1,759,330,837
se_79947806
stackoverflow
MOBILE_DEVELOPMENT
Why does the view&#39;s internal state is not updated for first mutation when doing it via an Computed Binding
Why does the view&#39;s internal state is not updated for first mutation when doing it via an Computed Binding Attaching the demo code: import SwiftUI struct BufferTest: View { @Binding var text: String @State private var buffer: String = "" @State private var presentModificationSheet: Bool = false ...
https://stackoverflow.com/questions/79947806/why-does-the-views-internal-state-is-not-updated-for-first-mutation-when-doing
ios, swift, swiftui
1,779,960,464
se_79874274
stackoverflow
MOBILE_DEVELOPMENT
AI makes me stop upgrading my skills, ended up making a vibe coder rather than a actual coder
AI makes me stop upgrading my skills, ended up making a vibe coder rather than a actual coder Well I am a beginner programmer and I was working in programming form my high school around 2019, but now I have some doubts I directly ask from AI and earlier I used to google it but I can't find some good answer. So I ended...
https://stackoverflow.com/questions/79874274/ai-makes-me-stop-upgrading-my-skills-ended-up-making-a-vibe-coder-rather-than-a
swift, swiftui, artificial-intelligence, project
1,769,142,941
se_79947612
stackoverflow
MOBILE_DEVELOPMENT
Subclassing SCNNode caused Swift 6 concurrency issues
Subclassing SCNNode caused Swift 6 concurrency issues I want to subclass SCNNode: open class MyContainer3D: SCNNode { public init(size: SCNVector3) { super.init() self.boundingBox = (min: SCNVector3(0, 0, 0), max: SCNVector3(size.x, size.y, size.z)) self.position = SCNVector3(0, 0, 0) } @available(...
https://stackoverflow.com/questions/79947612/subclassing-scnnode-caused-swift-6-concurrency-issues
ios, swift, concurrency
1,779,920,756
se_42895084
stackoverflow
MOBILE_DEVELOPMENT
swift protocol Equatable: Exposing nonvalue aspects of Equatable types other than class identity is discouraged
swift protocol Equatable: Exposing nonvalue aspects of Equatable types other than class identity is discouraged I'm currently studying swift API on protocol Equatable, and have encountered the following phrase Exposing nonvalue aspects of Equatable types other than class identity is discouraged Could someone explain...
https://stackoverflow.com/questions/42895084/swift-protocol-equatable-exposing-nonvalue-aspects-of-equatable-types-other-tha
swift, protocols, equatable
1,489,978,221
se_66453467
stackoverflow
MOBILE_DEVELOPMENT
is there a proper way to compose URL in Swift?
is there a proper way to compose URL in Swift? I'd like to understand if there Is a "golden standard" for assembling urls, someone told me this is an "elegant" way to do it. I think it is better since using the + with (strings), but it is THE way? (I know maybe there are multiple ways in iwich it works, but I'd like t...
https://stackoverflow.com/questions/66453467/is-there-a-proper-way-to-compose-url-in-swift
swift, url
1,614,760,843
se_43881978
stackoverflow
MOBILE_DEVELOPMENT
SpriteKit sktilemapnode vertical line glitch
SpriteKit sktilemapnode vertical line glitch I am making a 2d platformer and I decided to use multiple tilemapnodes as my backgrounds. Even with 1 tile map, I get these vertical or horizontal lines that appear and disappear when I'm moving the player around the screen. See image below: My tiles are 256x256 and I'm ...
https://stackoverflow.com/questions/43881978/spritekit-sktilemapnode-vertical-line-glitch
ios, swift, xcode, sprite-kit, sktilemapnode
1,494,377,816
se_69274075
stackoverflow
MOBILE_DEVELOPMENT
Xcode 13.0 with Swift 5.5 will no longer build my project with an &quot;import CreateML&quot; statement, how to fix?
Xcode 13.0 with Swift 5.5 will no longer build my project with an &quot;import CreateML&quot; statement, how to fix? After installing Xcode 13.0, which updates the version of Swift to 5.5, I am getting this error: Failed to build module 'CreateML'; this SDK is not supported by the compiler (the SDK is built with 'App...
https://stackoverflow.com/questions/69274075/xcode-13-0-with-swift-5-5-will-no-longer-build-my-project-with-an-import-create
swift, xcode
1,632,249,841
se_79947357
stackoverflow
MOBILE_DEVELOPMENT
ARKit ARCamera.intrinsics changes between frames and inconsistent sharpness in ARFrame.capturedImage
ARKit ARCamera.intrinsics changes between frames and inconsistent sharpness in ARFrame.capturedImage I am doing a personal research project around ARKit camera frames and camera calibration data. For each accepted ARFrame, I export: ARFrame.timestamp ARFrame.camera.imageResolution ARFrame.camera.intrinsics ARFrame.cap...
https://stackoverflow.com/questions/79947357/arkit-arcamera-intrinsics-changes-between-frames-and-inconsistent-sharpness-in-a
ios, swift, avfoundation, arkit
1,779,885,523
se_79946059
stackoverflow
MOBILE_DEVELOPMENT
How to make the selected center row in a wheel picker tappable?
How to make the selected center row in a wheel picker tappable? I want to replicate a wheel picker like the default iOS date wheel picker, where the selected center row is tappable to accept keyboard numeric inputs. Dragging on the center row should still trigger the default wheel picker behavior. ... @State var val...
https://stackoverflow.com/questions/79946059/how-to-make-the-selected-center-row-in-a-wheel-picker-tappable
swift, swiftui
1,779,676,777
se_79944102
stackoverflow
MOBILE_DEVELOPMENT
How can I force a UITabBar to use the light Liquid Glass appearance on iOS 26?
How can I force a UITabBar to use the light Liquid Glass appearance on iOS 26? I am seeing an issue with UITabBar Liquid Glass tinting on iOS 26. The issue seems to happen only when the light tab contains a UITableView. If I replace the table view with a plain UIViewController using only a white background, the issue ...
https://stackoverflow.com/questions/79944102/how-can-i-force-a-uitabbar-to-use-the-light-liquid-glass-appearance-on-ios-26
ios, swift, uitabbarcontroller, uitabbar, liquid-glass
1,779,285,609
se_39191148
stackoverflow
MOBILE_DEVELOPMENT
value of optional type &#39;string?&#39; not unwrapped when checking if values are empty
value of optional type &#39;string?&#39; not unwrapped when checking if values are empty I'm building a very simple login verification app in Xcode 7 using Swift. I'm extremely new to Swift (and building apps in general), so I'm having some difficulty with a part of my code. I'm checking whether a user has left any fi...
https://stackoverflow.com/questions/39191148/value-of-optional-type-string-not-unwrapped-when-checking-if-values-are-empty
ios, swift
1,472,386,434
se_79947040
stackoverflow
MOBILE_DEVELOPMENT
In Swift 6, after setting default actor isolation to main actor strange behaviors with protocol conformance
In Swift 6, after setting default actor isolation to main actor strange behaviors with protocol conformance I have this code: protocol MainP { func foo() } nonisolated protocol NonIsoP { func bar() } struct MainStruct1: MainP { func foo() {} } struct MainStruct2: NonIsoP { func bar() {} } nonisolated struc...
https://stackoverflow.com/questions/79947040/in-swift-6-after-setting-default-actor-isolation-to-main-actor-strange-behavior
ios, swift, concurrency
1,779,836,023
se_79946412
stackoverflow
MOBILE_DEVELOPMENT
Swift concurrency why use main actor isolated global values of sendable type in non isolated area
Swift concurrency why use main actor isolated global values of sendable type in non isolated area I have enabled approachable concurrency with default isolation to be main. I have this code: private let arc_total_degrees: CGFloat = 180 + 18 private let arc_start_degrees: CGFloat = 180 - 9 fileprivate struct MeterArc...
https://stackoverflow.com/questions/79946412/swift-concurrency-why-use-main-actor-isolated-global-values-of-sendable-type-in
ios, swift, concurrency
1,779,731,342
se_79946489
stackoverflow
MOBILE_DEVELOPMENT
Error &quot;Conformance of [StructType] to protocol [ProtocolType] crosses into main actor isolated code in approachable concurrency
Error &quot;Conformance of [StructType] to protocol [ProtocolType] crosses into main actor isolated code in approachable concurrency I have approachable concurrency enabled with main actor as the default isolation. I have this code: protocol RLActionState: CustomDebugStringConvertible {} struct RLWaitActionState: RLAc...
https://stackoverflow.com/questions/79946489/error-conformance-of-structtype-to-protocol-protocoltype-crosses-into-main
ios, swift, concurrency
1,779,745,903
se_43619359
stackoverflow
MOBILE_DEVELOPMENT
Is it possible to write a Swift function that replaces only part of an extended grapheme cluster?
Is it possible to write a Swift function that replaces only part of an extended grapheme cluster? I want to write a function that could be used like this: let 👩‍👩‍👧‍👦 = "👩‍👩‍👧‍👧".replacingFirstOccurrence(of: "👧", with: "👦") Given how odd both this string and Swift's String library are, is this possible in...
https://stackoverflow.com/questions/43619359/is-it-possible-to-write-a-swift-function-that-replaces-only-part-of-an-extended
swift, string, replace, emoji, unicode-string
1,493,148,443
se_46703542
stackoverflow
MOBILE_DEVELOPMENT
Alternatives to enum like functionality and able to extend in Swift
Alternatives to enum like functionality and able to extend in Swift I was implementing a framework internally(in company) in which application should work based on a Type provided. I was planning to implement that Type to be as enum. But developers who are trying to customize that functionality should be able to exten...
https://stackoverflow.com/questions/46703542/alternatives-to-enum-like-functionality-and-able-to-extend-in-swift
ios, swift, swift3, enums, frameworks
1,507,792,376
se_70029964
stackoverflow
MOBILE_DEVELOPMENT
View model &amp; model are not communicating
View model &amp; model are not communicating I have added three separate files to this question. The first one is my model which has all of my var from my json data. The 2nd one is my View Model in which i've created a function to decode the data from json. the 3rd is my collection view controller that will display ca...
https://stackoverflow.com/questions/70029964/view-model-model-are-not-communicating
swift, xcode, mvvm
1,637,296,803
se_52854101
stackoverflow
MOBILE_DEVELOPMENT
SceneKit/ARKit floor reflections reflectionCategoryBitMask
SceneKit/ARKit floor reflections reflectionCategoryBitMask I need to have a floor in the scene which will reflect only some objects, not all. I have created a floor in such a way: let floor = SCNFloor() floor.firstMaterial!.lightingModel = .constant floor.firstMaterial!.diffuse.contents = UIColor.clear flo...
https://stackoverflow.com/questions/52854101/scenekit-arkit-floor-reflections-reflectioncategorybitmask
swift, scenekit, arkit
1,539,776,686
se_52790140
stackoverflow
MOBILE_DEVELOPMENT
How do I store array of custom objects in core data?
How do I store array of custom objects in core data? Core data is still a bit new for me, so I don't quite understand the ins and outs. I understand how to save the basics like Strings, Ints, etc in core data, but I don't quite understand how to save an array of custom objects into core data, or if that is even possib...
https://stackoverflow.com/questions/52790140/how-do-i-store-array-of-custom-objects-in-core-data
arrays, swift, core-data
1,539,411,889
se_50957537
stackoverflow
MOBILE_DEVELOPMENT
Venmo Deeplinking
Venmo Deeplinking I have been looking into how to venmo deeplinking schemes and am trying to open a user's account based on their username. I looked all over the internet for this and closest I came was this blog post. The person in the blog post is so close to achieving what I'm going for but I still can not figure i...
https://stackoverflow.com/questions/50957537/venmo-deeplinking
swift, deep-linking, venmo
1,529,531,202
se_79945871
stackoverflow
MOBILE_DEVELOPMENT
UINavigationController push/pop animation no longer affected by layer speed in iOS 26
UINavigationController push/pop animation no longer affected by layer speed in iOS 26 You can set a view's layer.speed to affect the speed of its animations. If you do this at the window level you can make your entire app go fast, including page transitions, keyboard slide in/out etc. However since liquid glass this d...
https://stackoverflow.com/questions/79945871/uinavigationcontroller-push-pop-animation-no-longer-affected-by-layer-speed-in-i
swift, uinavigationcontroller, calayer, ios-animations, liquid-glass
1,779,627,175
se_79944351
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI iOS 26: ViewModel protocol + generic views for multi-platform Xcode preview injection. Best practice?
SwiftUI iOS 26: ViewModel protocol + generic views for multi-platform Xcode preview injection. Best practice? Context I'm building a multi-platform SwiftUI app targeting iOS 26 / macOS 26 (iPhone, iPad, Mac). I'm using MVVM with a Repository layer and the modern @Observable macro throughout. The app has list -> detail...
https://stackoverflow.com/questions/79944351/swiftui-ios-26-viewmodel-protocol-generic-views-for-multi-platform-xcode-prev
ios, swift, swiftui, mvvm, xcode-previews
1,779,319,378
se_79725723
stackoverflow
MOBILE_DEVELOPMENT
How to send Live Activity push token to server (like Airship or OneSignal) if app hasn&#39;t been opened for days?
How to send Live Activity push token to server (like Airship or OneSignal) if app hasn&#39;t been opened for days? What I Know So Far: You must call Activity.request(..., pushType: .token) inside the app to create a Live Activity and receive its push token. The token can be captured using for await activity.pushTokenU...
https://stackoverflow.com/questions/79725723/how-to-send-live-activity-push-token-to-server-like-airship-or-onesignal-if-ap
swift, push-notification, urbanairship.com, widgetkit, activitykit
1,754,377,892
se_69259457
stackoverflow
MOBILE_DEVELOPMENT
EA showBluetoothAccessoryPicker not showing in SwiftUI
EA showBluetoothAccessoryPicker not showing in SwiftUI I have created a small program that needs to connect to an external accessory. I have been able to do so successfully with UIKit and the EA framework. The problem I am having is that I have a SwiftUI based app that needs to use the External Accessory but when I ca...
https://stackoverflow.com/questions/69259457/ea-showbluetoothaccessorypicker-not-showing-in-swiftui
ios, swift, swiftui, external-accessory
1,632,163,699
se_79075682
stackoverflow
MOBILE_DEVELOPMENT
Need clarification about swift async / await
Need clarification about swift async / await I'm moving some stuff from pre-swift 6 dispatch queues to the newer concurrency model and I have a point of confusion that maybe somebody can clear up. It seems that the newer model doesn't actually handle the background-process / callback model, or at least I don't fully u...
https://stackoverflow.com/questions/79075682/need-clarification-about-swift-async-await
swift
1,728,584,092
se_79944829
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll
SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll I have a long home feed built as a SwiftUI ScrollView containing a VStack of sections. The last section is paginated when the user scrolls near the bottom, I fetch the next page and append rows to that section's data array. Once the...
https://stackoverflow.com/questions/79944829/swiftui-scrollview-shuffles-visible-content-when-appending-paginated-items-mid-s
ios, swift, swiftui, vstack, lazyvstack
1,779,385,006
se_69873970
stackoverflow
MOBILE_DEVELOPMENT
Convert a sync function to async using new concurrency in Swift
Convert a sync function to async using new concurrency in Swift I would like to convert a sync function to an async function, but I don't know what is the correct way to do it. Let assume I have a sync function that take a long time to get data: func syncLongTimeFunction() throws -> Data { Data() } Then I called it i...
https://stackoverflow.com/questions/69873970/convert-a-sync-function-to-async-using-new-concurrency-in-swift
swift, async-await
1,636,299,874
se_79912391
stackoverflow
MOBILE_DEVELOPMENT
Can UIActivityViewController be forced to use the compact share sheet on iOS 26.2?
Can UIActivityViewController be forced to use the compact share sheet on iOS 26.2? On iOS 26, some apps display UIActivityViewController as a compact floating card ("Liquid Glass" style). My implementation always shows a full-height sheet. What is required to trigger the compact iOS 26 presentation for UIActivityViewC...
https://stackoverflow.com/questions/79912391/can-uiactivityviewcontroller-be-forced-to-use-the-compact-share-sheet-on-ios-26
ios, swift, uiactivityviewcontroller, ios26
1,774,199,906
se_79000300
stackoverflow
MOBILE_DEVELOPMENT
Why does MacOS permission popup dismissed automatically?
Why does MacOS permission popup dismissed automatically? I'm creating a plugin for Final Cut Pro and when I add the observable for the timeline it shows the popup asking for Automation permissions. The problem is that the popup stays visible only for 1 second and dismisses itself automatically, adding the observable b...
https://stackoverflow.com/questions/79000300/why-does-macos-permission-popup-dismissed-automatically
swift, finalcut
1,726,697,231
se_43777618
stackoverflow
MOBILE_DEVELOPMENT
How to convert string to data with 32 bytes count in iOS Swift 3.1
How to convert string to data with 32 bytes count in iOS Swift 3.1 How to convert string to data or NSData with 32 bytes count in iOS Swift 3. I have a key like this: let keyString = "hpXa6pTJOWDAClC/J6POVTjvJpMIiPAMQiTMjBrcOGw=" and test this code for convert to Data: let keyData: Data = keyString.data(using...
https://stackoverflow.com/questions/43777618/how-to-convert-string-to-data-with-32-bytes-count-in-ios-swift-3-1
ios, swift, aes, nsdata, encode
1,493,886,377
se_58444689
stackoverflow
MOBILE_DEVELOPMENT
SwiftUI hide TabBar in subview
SwiftUI hide TabBar in subview I am working with SwiftUI, and I have some issues with the TabBar. I want to hide the TabBar on a specific subview. Have tried with UITabBar.appearance().isHidden = true It only works on the direct views in the TabView. But when I place it in a subview it doesn't work. Have anyone...
https://stackoverflow.com/questions/58444689/swiftui-hide-tabbar-in-subview
swift, xcode, swiftui, ios13
1,571,377,906
se_79943794
stackoverflow
MOBILE_DEVELOPMENT
How to Apply Regexes to AttributedString
How to Apply Regexes to AttributedString I'm creating a syntax highlighter, but that requires regexes (I know, not the most great thing for highlighters, but this was a test run). But when I tried using AttributedString with regexes, it doesn't work. But also, the String method for regexes (which I am debating is eith...
https://stackoverflow.com/questions/79943794/how-to-apply-regexes-to-attributedstring
swift
1,779,250,191
se_66170570
stackoverflow
MOBILE_DEVELOPMENT
How to display the selected menu item in SwiftUI?
How to display the selected menu item in SwiftUI? I want to selected menu to get displayed and saved when the user comes back later. my current code just displays the selected item, but not getting saved when I close the sheet and comes back. @State var selectedAge: Int = .zero var body: some View { Menu {...
https://stackoverflow.com/questions/66170570/how-to-display-the-selected-menu-item-in-swiftui
ios, arrays, swift, swiftui, swiftui-list
1,613,127,424
se_79943809
stackoverflow
MOBILE_DEVELOPMENT
SwiftData crash Task isolating closure inside AsyncStream in @Observable viewmodel?
SwiftData crash Task isolating closure inside AsyncStream in @Observable viewmodel? I'm losing my mind here. I just upgraded my project to use the new @Observable macro and SwiftData instead of CoreData. Everything was working fine until I tried to implement a real-time network sync that streams data updates using Asy...
https://stackoverflow.com/questions/79943809/swiftdata-crash-task-isolating-closure-inside-asyncstream-in-observable-viewmod
swift, swiftdata
1,779,252,555
se_33322321
stackoverflow
MOBILE_DEVELOPMENT
Adding a checkbox to every cell in the tableView
Adding a checkbox to every cell in the tableView I've already made a table view which allows the user to add tasks to the table view, but now I need to add a checkbox in front of each task, so that the user can select which tasks she/he wants to send to an other viewController. After I googled it, I realized that ther...
https://stackoverflow.com/questions/33322321/adding-a-checkbox-to-every-cell-in-the-tableview
ios, swift, uitableview
1,445,714,439
se_69420028
stackoverflow
MOBILE_DEVELOPMENT
Incomplete file/copyright headers in Swift Package with Xcode 12 / 13
Incomplete file/copyright headers in Swift Package with Xcode 12 / 13 Is there any way to automatically add package/target name and copyright + company name to the header when creating new files while developing a swift package with Xcode 12/13? Just create a new package (File > New > Package) and add a new file to th...
https://stackoverflow.com/questions/69420028/incomplete-file-copyright-headers-in-swift-package-with-xcode-12-13
ios, swift, xcode, package, swift-package
1,633,206,453
se_79773367
stackoverflow
MOBILE_DEVELOPMENT
Decode base64 string with line wrap in Swift
Decode base64 string with line wrap in Swift RFC2045 base64 string has line length of 76 characters. And when in Swift, I can't find an option to decode it back. import Foundation let inputData = "Hello, testing Base 64 that can have wrapping, when the string is very long".data(using: .utf8)! let base64String = input...
https://stackoverflow.com/questions/79773367/decode-base64-string-with-line-wrap-in-swift
swift, base64
1,758,697,675
se_79942341
stackoverflow
MOBILE_DEVELOPMENT
How to achieve a 2 column grid of cards that expand into a full screen view when tapped upon?
How to achieve a 2 column grid of cards that expand into a full screen view when tapped upon? I am trying to make a notes view where the individual notes will be displayed in a scrollable grid of two columns. I want to make it so that if a note card is tapped upon, it opens the full note and takes over the entire scre...
https://stackoverflow.com/questions/79942341/how-to-achieve-a-2-column-grid-of-cards-that-expand-into-a-full-screen-view-when
ios, swift, swiftui
1,778,985,323
se_79942258
stackoverflow
MOBILE_DEVELOPMENT
How to support non-Sendable values in Mutex + propertyWrapper usage
How to support non-Sendable values in Mutex + propertyWrapper usage I have this code: @available(iOS 18.0, *) @propertyWrapper public final class Atomic<Value: Sendable>: Sendable { private let mutex: Mutex<Value> public init(wrappedValue: Value) { self.mutex = Mutex(wrappedValue) } public var wrappedValue...
https://stackoverflow.com/questions/79942258/how-to-support-non-sendable-values-in-mutex-propertywrapper-usage
swift, concurrency
1,778,957,143