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
Search results for
swiftui
16,584 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
Hello, I am facing a recurring issue with Xcode iOS simulator (preview). I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up. I receive the following error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Completely uninstalling XCode and deleting all developer data, then reinstalling everthing again. Shutdown and restart Deleting all developer data, deleting XCode cache Reinstalling iOS Simulator runtimes and reconfiguration of simulators. Tested using different simulator and runtime versions. xcrun simctl --set previews delete al My reported issues: FB20987522 FB20485454 Thank you Best regards, Jens
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Xcode Previews
Xcode
Simulator
Business and Enterprise
I have a ScrollView with several Buttons and a .refreshable modifier. As soon as I pull to refresh and the refresh indicator appears, the tap targets no longer match the visible button positions. For example, tapping button A triggers button B’s action, as if the hit-testing region didn’t move along with the content. This only happens while the refresh indicator is shown. Before pulling to refresh, everything is correct and afterwards as well. Tested on iOS 18 and 26 (Xcode 16.4, Xcode 26). Here is a minimal reproducible example: import SwiftUI struct ContentView: View { var body: some View { ScrollView { VStack { Button(Button A) { print(A) } .buttonStyle(.borderedProminent) Button(Button B) { print(B) } .buttonStyle(.borderedProminent) Button(Button C) { print(C) } .buttonStyle(.borderedProminent) Button(Button D) { print(D) } .buttonStyle(.borderedProminent) Button(Button E) { print(E) } .buttonStyle(.borderedProminent) } .frame(maxWidth: .infinity) } .refreshable { try? await Task.sleep(for: .sec
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 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:
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
When scrolling a basic NSScrollView there seems to be a sudden jump after each flick. Scrolling does not appear smooth and is disorientating. A scroll jump seems to happen directly after letting go of a scroll flick using a trackpad/mouse. Right at that moment the scroll turns into a momentum scroll, slowly decreasing the speed. But the first frame after the gesture the content jumps forward, more than what is expected. Observations: Counterintuitively, scrolling appears to be smoother when disabling NSScrollView.isCompatibleWithResponsiveScrolling. If disabled using a custom NSScrollView subclass there is no large jump anymore. Scrolling also appears to be smoother using a SwiftUI ScrollView. I assume that has the same behaviour as a disabled isCompatibleWithResponsiveScrolling Ironically a WKWebView scrolls much smoother. No sudden jump is observable. It also seems to scroll with faster acceleration, but the individual frames do appear smoother. Why is this better than a native NSScrollView? Elasti
The PaperMarkup class in PaperKit allows for an asynchronous function called .draw(in:, frame:) that we should call as: await paperMarkup.draw(in: context.cgContext, frame: rect) In PencilKit the PKDrawing that we can get from a PKCanvasView allows for .image(from: ,scale:) to be called synchronously. This allows me to easily render into a PKDrawing as a UIImage or a SwiftUI Image to, for example, render a thumbnail on screen. When trying to incorporate PaperKit in my project I noticed that I often need the drawing to be rendered synchronously (like I would with PKDrawing) but I can't find the way to accomplish this within PaperKit's current functionality. Is there any way to call .draw(...) in PaperKit synchronously? Feedback: FB20993683
I'm using the SwiftUI Photos Picker to select videos from the users Photos library and then opening the video using the PhotosPickerItem. I'm looking for a way to allow the user to open the same video on their other devices as the app uses SwiftData and CloudKit to provide access to a recently watched list of videos. The URL from the PhotosPickerItem appears to be device specific and so I was looking to see if I can use the itemIdentifier and then the init that takes the itemIdentifier to create the PhotosPickerItem on the other devices. The itemIdentifier however is always nil and so wouldn't be able to be used in this way. Is there an alternative approach whereby the users can open a video using a PhotosPickerItem and that item would be viewable on their other devices with an item identifier or a URL that is device agnostic. This approach should also not involve copying the video into other storage as it would simply expand the use of the users iCloud storage, providing a less than ideal user exper
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
[Also submitted as FB20756013] A popoverTip does not display for toolbar menu buttons in iOS 26.1 (23B5073a). The same code displays tips correctly in iOS 18.6. The issue occurs both in the simulator and on a physical device. Repro Steps Build and run the Sample Code below on iOS 26.1. Observe that the popoverTip does not display. Repeat on iOS 18.6 to confirm expected behavior. Expected popoverTips should appear when attached to a toolbar menu button, as they do in iOS 18.6. Actual No tip is displayed on iOS 26.1. System Info macOS 15.7.1 (24G231) Xcode 26.1 beta 3 (17B5045g) iOS 26.1 (23B5073a) Screenshot Screenshot showing two simulators side by side—iOS 18.6 on the left (tip displayed) and iOS 26.1 on the right (no tip displayed). Sample code import SwiftUI import TipKit struct PopoverTip: Tip { var title: Text { Text(Menu Tip) } var message: Text? { Text(This tip displays on iOS 18.6, but NOT on iOS 26.1.) } } struct ContentView: View { var tip = PopoverTip() var body: some View { NavigationStac
SwiftUI’s Menu is used also to display view controls like pop-up buttons. However, in such cases, its content is evaluated at the moment the button itself appears, although it’s not required until the menu is actually opened. Additionally, since the menu content isn’t re-evaluated when opened, if the content is dynamically generated, there could be a discrepancy between the actual state and the displayed state depending on the timing. Considering these points, I’d like to delay generating the menu content until the moment it’s actually opened. Is there a way to delay the evaluation and generation of the Menu’s content until the moment its contents are displayed? Note: I'd like to know about using it within a macOS app.
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.