I am getting this error msg when I try to run a SwiftUI Preview on an iOS 15.5 simulator: Termination Reason: Namespace DYLD, Code 1, Library missing | Library not loaded: /usr/lib/swift/libswift_StringProcessing.dylib | Referenced from: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libLiveExecutionResultsLogger.dylib | Reason: tried: '/Users/hfg/Library/Developer/Xcode/DerivedData/Testios15sim-aawlbfbtggzozseoekycwwpadhrc/Build/Intermediates.noindex/Previews/iphonesimulator/Testios15sim/Products/Debug-iphonesimulator/libswift_StringProcessing.dylib' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswift_StringProcessing.dylib' (no such file), '/usr/lib/swift/libswift_StringProcessing.dylib' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libswift_StringProcessing.dylib' (no
Search results for
swiftui
16,439 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Why a TipKit configured with a weekly frequency, on the following example, when the app is launched on the View1, the tip is displayed. I thought that going to View2 and come back to View1 should not redisplayed the tip (at least until one week). What do I miss? import SwiftUI import TipKit struct FavoriteLandmarkTip: Tip { var title: Text { Text(Save as a Favorite) } var message: Text? { Text(Your favorite landmarks always appear at the top of the list.) } var image: Image? { Image(systemName: star) } } @main struct LandmarkTips: App { var body: some Scene { WindowGroup { TabView { View1() .tabItem { Label(View1, systemImage: house) } View2() .tabItem { Label(View2, systemImage: house) } } .task { do { // uncomment to reset all tips status // try? Tips.resetDatastore() try Tips.configure([ .displayFrequency(.weekly), .datastoreLocation(.applicationDefault) ]) } catch { print(Error initializing TipKit (error.localizedDescription)) } } } } } struct View1: View { let favoriteLandmarkTip = FavoriteLandm
When I run the following code and change Is On, I get a problem with the layout of the Picker. There is no problem when using Text(), but when using only Image, it works fine on iOS but there is a problem on macOS. Tested on macOS 26.1, Xcode 26.1. import SwiftUI struct ContentView: View { @State var model = Model() var body: some View { Form { Picker(Category, selection: $model.category) { ForEach(Category.allCases) { item in Image(systemName: item.icon) .tag(item) } } .pickerStyle(.segmented) Toggle(Is On, isOn: $model.isOn) } .formStyle(.grouped) } } struct Model { var category: Category = .a var isOn: Bool = false } enum Category: Int, Identifiable, CaseIterable { case a, b, c var id: Int { rawValue } var icon: String { switch self { case .a: return a.circle.fill case .b: return b.circle.fill case .c: return c.circle.fill } } var name: String { switch self { case .a: return a case .b: return b case .c: return c } } } code-block
Description On iOS 26.1, a ToolbarItem placed in .keyboard is no longer exposed to the accessibility hierarchy. As a result: VoiceOver cannot focus or activate the toolbar button XCUITest cannot discover the element, making the UI impossible to test TextEditor() .toolbar { ToolbarItem(placement: .keyboard) { Button(Done) { /* action */ } } } This worked correctly on previous iOS versions. The button appears visually but is missing from both VoiceOver navigation and XCUI accessibility queries. Steps to Reproduce Create a new SwiftUI project. Use a simple text field with a keyboard toolbar button. Run on an iOS 26.1 device or simulator. Focus the text field to show the keyboard. Turn on VoiceOver and attempt to navigate to the toolbar button. Run an XCUITest attempting to locate the button
Hello Im having similar issues, however with Instrumenting a macOS application. Instruments + SwiftUI was working great with XCode 16.3 and macOS 15.5 I recently updated to macOS 15.7.2 and XCode 26.1.1 And now When I run my application via Product -> Profile (Command I) SwiftUI Template Run Instruments launches my app for a microsecond, and then fails with Failed to start the recording: Failed starting ktrace session. Some notes For my macOS target, i can only choose deferred mode for the Recorder Settings
Topic:
Developer Tools & Services
SubTopic:
Instruments
Tags:
For completeness, this is the view I'm experimenting with: import AVFoundation import SwiftUI class EngineerPlayer { let audioEngine = AVAudioEngine() let playerNode = AVAudioPlayerNode() let environmentNode = AVAudioEnvironmentNode() init(_ url: URL) throws { let audioFile = try AVAudioFile(forReading: url) let mono = AVAudioFormat(standardFormatWithSampleRate: audioFile.processingFormat.sampleRate, channels: 1) let stereo = AVAudioFormat(standardFormatWithSampleRate: audioFile.processingFormat.sampleRate, channels: 2) audioEngine.attach(playerNode) audioEngine.attach(environmentNode) audioEngine.connect(playerNode, to: environmentNode, format: mono) audioEngine.connect(environmentNode, to: audioEngine.mainMixerNode, format: stereo) audioEngine.prepare() try audioEngine.start() environmentNode.renderingAlgorithm = .HRTFHQ playerNode.pointSourceInHeadMode = .mono playerNode.position = AVAudio3DPoint(x: 0, y: 2, z: 10) playerNode.scheduleFile(audioFile, at: nil, completionHandler: nil) } func updatePo
Topic:
Media Technologies
SubTopic:
Audio
Tags:
Try this simple code: import SwiftUI import StoreKit struct ReviewView: View { @Environment(.requestReview) var requestReview var body: some View { Button(Leave a review) { requestReview() } } } When the Review Alert shows, the Not Now button is disabled for some reason!? It was always tappable in all iOS versions that I remember. And there is no way to opt out, unless the user taps on the stars first. Is it a bug or a feature? Thanks for looking into it!
A MacOS SwiftUI app using WindowGroup with a NavigationStack results in having the navigation title overlay the back button. Note that this does not occur if a tabbed interface is used. The work around is simply to hide the navigation bar back button and add a tool bar item that is custom back button. I found a fix on this forum, and it was similar to: #if os(macOS) .navigationBarBackButtonHidden(true) .toolbar { ToolbarItem(placement: .navigation) { Button(action: { dismiss() }) { Label(Back, systemImage: arrow.left.circle) } } } #endif modifying the NavigationLink targets and where the dismiss() function was provided by: @Environment(.dismiss) private var dismiss Is there any means to sign up for a notification to inform me that this bug has been fixed?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Device: iPhone [model], iOS 18.6.2 Xcode: 16.0.x Team: Individual paid Apple Developer Program (not Personal Team), shows as my full name in Xcode I’m trying to use CoreNFC via NFCTagReaderSession in a small SwiftUI app (part of a larger project). So far I’ve done: • Enrolled in the Apple Developer Program (individual). • Confirmed that in Certificates, Identifiers & Profiles → Identifiers, my App ID for com.<…> has Near Field Communication Tag Reading enabled. • Created an iOS App Development provisioning profile for that App ID, including: • my Apple Development certificate • my iPhone device • Downloaded the profile, double-clicked it, and set it in Xcode under Signing & Capabilities with: • Team = my full-name team • “Automatically manage signing” off, using the custom profile. • Added the NFC Scan capability in Signing & Capabilities. • Added Privacy - NFC Scan Usage Description (NFCReaderUsageDescription) in Info.plist with a non-empty string. The app builds and runs on device
Hello - I’m the Account Holder for an individual Apple Developer Program account. I’m working with freelance junior developers who are building my app in React Native mainly in TypeScript (.tsx) with some JavaScript, with code in GitHub. The app currently runs in Expo Go now. I’ve been directed to this forum for step-by-step guidance. Specifically I need clear, sequential instructions I can give my developers (and what I personally must do on my Mac) so they can produce a properly signed iOS build for TestFlight (internal testing), and Upload that build to App Store Connect and then submit the release to the App Store. Context: This is an individual developer account (not an organization). I am the only person with a Mac. I added them as developers but was told I need to be the one to upload the final build (is this true, and if so, what do they send me to do that, and when they send it to me, can you please tell me exactly what I need to do from there?) I was told about Swift Playground, possible SwiftUI
I just updated to macOS 26.1. I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get). I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols. With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things. Additio
Release notes of Xcode 26.2 https://developer.apple.com/documentation/xcode-release-notes/xcode-26_2-release-notes state that Swift 6.2.3 is shipped with it. But when trying to check the Swift version with #if swift(>= 6.2.3) it returns false. Running swiftc -version returns swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.3.3.2 clang-1700.6.3.2) As you can see, there is a mismatch between the marketing version 6.2 and the build version 6.2.3.3.2. Being able to check for the 6.2.3 version is important for my team, because we are impatiently awaiting the change to the tabviewbottomaccessory modifier https://developer.apple.com/documentation/swiftui/view/tabviewbottomaccessory%28isenabled:content:%29 so that it can be hidden when not needed. Without this fix we have the issue that the accessory shows even without content in iOS 26.1.
Hello, I’m trying to present my custom SwiftUI dialog with text field in UIKit with modalPresentationStyle = .overFullScreen, but it leads to the UI being completely frozen once I select the TextField and memory constantly leaking. The minimal reproducible code is: class ModalBugViewController: UIViewController { var hostingController: UIHostingController! struct Content: View { @State private var text = var body: some View { ZStack { Color.black.opacity(0.5).ignoresSafeArea() VStack { TextField(Test, text: $text) .textFieldStyle(.roundedBorder) .padding() } } } } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear hostingController = UIHostingController(rootView: Content()) addChild(hostingController) view.addSubview(hostingController.view) hostingController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), hostingController.view.bottomAnchor.constraint(equalTo: view.
Summary I’m experiencing two issues with SwiftUI’s navigationTransition(.zoom) on iOS 26.0 and 26.1 that break previously smooth transitions. These issues appear both on real devices and Simulator. The same code works correctly on iOS 18. Issue 1 - Source View Disappears After Drag-Dismiss When using .navigationTransition(.zoom(sourceID:..., in:...)), the source view disappears completely after the transition finishes. This only happens when the detail view is dismissed via drag (interactive dismiss). When the view is dismissed by tapping the back button, the source view remains visible as expected. Reproduced on: iOS 26.0, iOS 26.0.1 (17A400), iOS 26.1 (Simulator + physical device) Issue 2 — Flickering and Geometry Mismatch During Transition Compared to iOS 18 behavior, the outgoing view and incoming view no longer share consistent geometry. Current behavior on iOS 26: The disappearing view flickers during the drag-dismiss interaction. The source and destination views no longer align geometrically.
Topic:
UI Frameworks
SubTopic:
SwiftUI
What most likely has happened is Apple made changes to the user interface in Xcode 26 and the tutorial you are following has not been updated for Xcode 26. You can file a request for Apple to update the tutorial. In Xcode choose Help > Provide Feedback to send the request. I have not gone through the tutorial so I can't tell you how to go through the tutorial in Xcode 26. I recommend taking the 100 Days of SwiftUI at Hacking with Swift. https://www.hackingwithswift.com/100/swiftui This course is geared towards beginners. Hacking with Swift also has a dedicated forum for the course (https://www.hackingwithswift.com/forums/100-days-of-swiftui) to ask questions when you run into problems with the course. The forums at Hacking with Swift are more beginner-friendly than Apple's forums.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: