Search results for

“swiftui”

17,110 results found

Post

Replies

Boosts

Views

Activity

Reply to Extended Runtime API - Health Monitoring
Thanks for your update. Related to this is still that clarity on if I need to implement @WKExtensionDelegateAdaptor I guess you meant WKApplicationDelegateAdaptor by WKExtensionDelegateAdaptor, assuming that your watchOS app is a single-target app? (See TN3157 for the defintion of the term.) In theory, based on the documentation, if you added backgroundTask(_:action:) in your SwiftUI app, you wouldn't need to implement the app delegate’s handle(_:), and hence wouldn't need to implement @WKApplicationDelegateAdaptor (unless you still need something that the SwiftUI app life cycle doesn't provide). In practice, I am actually curious if adding @WKApplicationDelegateAdaptor + implementing the app delegate’s handle(_:) to complete all the background tasks helps avoid the watchdog termination in any way – If yes, there will be a bug related to backgroundTask(_:action:). Maybe you can give it a try, given that you have the test environment? Then there's the 4 updates per hour with a complication on
Mar ’26
NavigationSplitView macOS
I want to create SplitView App for macOS like Apple Mail. Is it possible using swiftUI NavigationSplitView or should I use AppKit to achieve it. I want exact toolbar buttons also. Filter button will be in Invoice list pane and other buttons in the details pane. Also, I want details pane completely collapsable(just like in Mail app).
Topic: UI Frameworks SubTopic: SwiftUI
2
0
138
Mar ’26
Instruments Malfunction
I’m reporting a severe reproducible issue in Instruments, specifically when using the SwiftUI instrument and opening Show Cause & Effect Graph. What happens: • Instruments becomes extremely laggy/unresponsive • The graph/detail area can turn solid magenta/pink • Memory usage rapidly increases (I observed around 18 GB, 25 GB, and up to 34 GB) • My Mac has crashed/restarted during this, or in other terms, had a kernel panic, where my Mac froze, and everything unresponsive. The Trackpad wouldn't even click. Important detail: • I could not find a generated kernel panic log after the crash/restart. Repro context: • SwiftUI iOS app profiled from Xcode • Trigger is specifically entering Show Cause & Effect Graph • Recordings can be short and still trigger it • Issue is much less severe or absent if I avoid that view What I already tried: • Rebooting • Short captures / fewer instruments • Clearing Xcode/Instruments caches/preferences • Retesting after cleanup • Reinstalling Xcode Is this a k
2
0
263
Mar ’26
Best approach for animating a speaking avatar in a macOS/iOS SwiftUI application
I am developing a macOS application using SwiftUI (with an iOS version as well). One feature we are exploring is displaying an avatar that reads or speaks dynamically generated text produced by an AI service. The basic flow would be: Text generated by an AI service Text converted to speech using a TTS engine An avatar (2D or 3D) rendered in the app that animates lip movement synchronized with the speech Ideally the avatar would render locally on the device. Questions: What Apple frameworks would be most appropriate for implementing a speaking avatar? SceneKit RealityKit SpriteKit (for 2D avatars) Is there any recommended way to drive lip-sync animation from speech audio using Apple frameworks? Does AVSpeechSynthesizer expose phoneme or viseme timing information that could be used for avatar animation? If such timing information is not available, what is the recommended approach for synchronizing character mouth animation with speech audio on macOS/iOS? Are there examples of real-time character animat
0
0
867
Mar ’26
How do you support Preferred Font Size / Dynamic Type on macOS?
On macOS 26, how do you support the Preferred Text Size value as defined in the Accessibility Settings? Historically, Dynamic Type has not been available on macOS. However, the user has some control over text size through the Accessibility Settings. On macOS 26, a small subset of applications are honouring changes to that value include Finder, Mail, and sidebars in many applications. Dynamic sizing in table views has been available on macOS for awhile. But Mail.app, in particular, is also adjusting the font sizes used in the message's body pane while the Finder is adjusting font sizes used for Desktop icons. I can't find an NSNotification that is fired when the user adjusts the Accessibility Text Size slider, nor can I find an API to read the current value. NSFont.preferredFont(forTextStyle:options:) looks promising but the fonts returned do not appear to take the user's Accessibility setting into account. (Nor do they update dynamically.) SwiftUI's Text(Apple).font(.body) performs similarly to NSFon
2
0
564
Mar ’26
Swift compiler fails in Release (-O) when using generic ObservableObject with @Published on iOS < 26 in Xcode 26.3
When building a SwiftUI project in Xcode 26.3, Swift compilation fails in the Release configuration with Optimization Level set to -O, when the iOS deployment target is lower than iOS 26 (e.g. iOS 16, 17, or 18). The failure occurs when using a generic class conforming to ObservableObject that contains a @Published property. The same code: Compiles successfully in Xcode 16.3 (Release, -O) with iOS 16/17/18 Compiles successfully in Xcode 26.x when the deployment target is set to iOS 26 Compiles successfully in Xcode 26.x Debug configuration (-Onone) Compiles successfully in Xcode 26.x Release when optimization is disabled (-Onone) However, in Xcode 26.3, the build consistently fails in Release (-O) when targeting iOS 16, 17, or 18. This appears to be a Swift compiler optimization issue related to generics, ObservableObject, @Published, and back-deployment to iOS versions prior to iOS 26. STEPS TO REPRODUCE Create a new SwiftUI App project using Xcode 26.3. Leave all project settings at defaul
3
0
340
Mar ’26
Reply to Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
For UIKit, isDarkerSystemColorsEnabled indicates whether Increase Contrast is active. To receive updates when this setting changes, observe darkerSystemColorsStatusDidChangeNotification. For AppKit, the accessibilityDisplayShouldIncreaseContrast property indicates if a high-contrast user interface should be presented. Apps can register accessibilityDisplayOptionsDidChangeNotification to respond to changes in this setting Lastly, SwiftUI has colorSchemeContrast, an environment value that provides information on whether standard or increased contrast applies to a view. SwiftUI automatically updates this value when the contrast changes, redrawing views that depend on it. I encourage you to share your workarounds here, as well as file separate bug reports against each app that displays incorrectly. Once complete, post those FB numbers in this thread and I will make sure they get the correct eyes on them. Thank you.  Travis
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’26
Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
[Submitted as FB22200608] With Increase Contrast turned on, the selected row highlight in a List behaves inconsistently between light and dark appearance on iPad. In light appearance the blue selection highlight correctly becomes darker, but in dark appearance it becomes lighter instead. The text contrast ratio drops from about 3:1 to about 1.5:1, well below accessibility guidelines. This reproduces both in the simulator and on a physical device. The sample uses a standard SwiftUI List inside NavigationSplitView with built-in selection styling. No custom colors or styling are applied. REPRO STEPS Create a new Multiplatform project. Replace ContentView with code below. Build and run on iPad. Select an item in the list. Turn on Dark appearance (Cmd-Shift-A in Simulator). Turn on Increase Contrast (Cmd-Control-Shift-A in Simulator). Observe the selected row highlight. ACTUAL In light appearance, the blue selection highlight becomes darker when Increase Contrast is on, improving contrast as expected. In
5
0
628
Mar ’26
ScrollView hicjacking focus in swiftui
Greetings! I'm facing a problem handleling full keyboard access in my app. This is a simpler version of the code: struct PrimerTest: View { @FocusState private var focusedImage: Int? var body: some View { VStack(alignment: .leading, spacing: 20) { Link(Go to google or smth, destination: URL(string: https://google.com)!) .font(.headline) Text(First text) Text(Second text) HStack { Text(Label) .accessibilityHidden(true) Spacer() Button(Play) { print(Im a button) } } Text(Selecciona un perfil con el teclado (Tab):) .font(.caption) .foregroundColor(.secondary) HStack { ForEach(0..<5, id: .self) { index in Image(systemName: person.circle.fill) .resizable() .frame(width: 30, height: 30) .focusable(true) .focused($focusedImage, equals: index) .foregroundStyle(focusedImage == index ? Color.blue : Color.gray) .scaleEffect(focusedImage == index ? 1.2 : 1.0) .animation(.easeInOut, value: focusedImage) .accessibilityHidden(true) } } } .navigationTitle(Title n stuff) .padding() } } And the focus behaves as expected and
2
0
1k
Mar ’26
ShareLink "Save Image" action dismisses presenting view after saving
When using ShareLink in SwiftUI to share an image, the “Save Image” action dismisses not only the share sheet but also the presenting SwiftUI view. The behavior differs depending on whether the photo library permission alert appears. Observed behavior: The first time the user taps Save Image, the system permission alert appears. After granting permission, the image saves successfully and the share sheet dismisses normally. On subsequent attempts, the image is saved successfully, but both the share sheet and the presenting view are dismissed unexpectedly. Expected behavior: After saving the image, only the share sheet should dismiss. The presenting SwiftUI view should remain visible. Steps to Reproduce Present a SwiftUI view using .sheet. Inside that view, add a ShareLink configured to export a PNG image using Transferable. Tap the ShareLink button. Choose Save Image. Grant permission the first time (if prompted). Repeat the action. Result: On subsequent saves, the share she
4
0
153
Mar ’26
ShareLink "save Image" action dismiss parent view
ShareLink works fine except for save image action which dismiss the presenting view first time system shows the premission alert so image get saved without any problem but for the next saves image get saved then share sheet dismiss and also presenting view dismiss as well here is a sample code ` internal import System import UniformTypeIdentifiers import SwiftUI struct RootView: View { @State private var isPresented: Bool = false var body: some View { ZStack { Color.white Button(Show parent view) { isPresented = true } } .sheet(isPresented: $isPresented) { ParentView() } } } struct ParentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { ZStack { Color.red.opacity(0.5) } .toolbar { ToolbarItem() { let name = (UUID().uuidString) let image = UIImage(named: after)! return ShareLink( item: ShareableImage(image: image, fileName: name), preview: SharePreview( name, image: Image(uiImage: image) ) ) { Image(uiImage: UIImage(resource: .Icons.share24)) .resizable(
1
0
103
Mar ’26
iOS 26+ UITabBar unselected item colors not updating with UITabBarAppearance
I'm using UITabBarAppearance to customize my TabBar in a SwiftUI app. The customization works perfectly on iOS 18 and earlier, but after updating to iOS 26, the unselected tab items no longer respect my color settings - they just appear black (they are on a white background).Here's my simplified setup: struct ContentView: View { var body: some View { TabView { Text(Home) .tabItem { Image(systemName: house) Text(Home) } .tag(0) Text(Settings) .tabItem { Image(systemName: gear) Text(Settings) } .tag(1) } .onAppear { setupTabBarAppearance() } } private func setupTabBarAppearance() { let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() // These settings work for selected items itemAppearance.selected.iconColor = .systemBlue itemAppearance.selected.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.systemBlue ] // These settings STOPPED working on iOS 26 for unselected items itemAppearance.normal
1
0
236
Mar ’26
Reply to Extended Runtime API - Health Monitoring
Thanks for your update. Related to this is still that clarity on if I need to implement @WKExtensionDelegateAdaptor I guess you meant WKApplicationDelegateAdaptor by WKExtensionDelegateAdaptor, assuming that your watchOS app is a single-target app? (See TN3157 for the defintion of the term.) In theory, based on the documentation, if you added backgroundTask(_:action:) in your SwiftUI app, you wouldn't need to implement the app delegate’s handle(_:), and hence wouldn't need to implement @WKApplicationDelegateAdaptor (unless you still need something that the SwiftUI app life cycle doesn't provide). In practice, I am actually curious if adding @WKApplicationDelegateAdaptor + implementing the app delegate’s handle(_:) to complete all the background tasks helps avoid the watchdog termination in any way – If yes, there will be a bug related to backgroundTask(_:action:). Maybe you can give it a try, given that you have the test environment? Then there's the 4 updates per hour with a complication on
Replies
Boosts
Views
Activity
Mar ’26
Reply to Crash while presenting a media picker for Music
Still when I try to create a new project, I'm presented with a swiftUI framework I do not know what to make with. Is not any longer possible to start a new project with storyboard and using plain Swift code?
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Mar ’26
NavigationSplitView macOS
I want to create SplitView App for macOS like Apple Mail. Is it possible using swiftUI NavigationSplitView or should I use AppKit to achieve it. I want exact toolbar buttons also. Filter button will be in Invoice list pane and other buttons in the details pane. Also, I want details pane completely collapsable(just like in Mail app).
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
138
Activity
Mar ’26
Instruments Malfunction
I’m reporting a severe reproducible issue in Instruments, specifically when using the SwiftUI instrument and opening Show Cause & Effect Graph. What happens: • Instruments becomes extremely laggy/unresponsive • The graph/detail area can turn solid magenta/pink • Memory usage rapidly increases (I observed around 18 GB, 25 GB, and up to 34 GB) • My Mac has crashed/restarted during this, or in other terms, had a kernel panic, where my Mac froze, and everything unresponsive. The Trackpad wouldn't even click. Important detail: • I could not find a generated kernel panic log after the crash/restart. Repro context: • SwiftUI iOS app profiled from Xcode • Trigger is specifically entering Show Cause & Effect Graph • Recordings can be short and still trigger it • Issue is much less severe or absent if I avoid that view What I already tried: • Rebooting • Short captures / fewer instruments • Clearing Xcode/Instruments caches/preferences • Retesting after cleanup • Reinstalling Xcode Is this a k
Replies
2
Boosts
0
Views
263
Activity
Mar ’26
Best approach for animating a speaking avatar in a macOS/iOS SwiftUI application
I am developing a macOS application using SwiftUI (with an iOS version as well). One feature we are exploring is displaying an avatar that reads or speaks dynamically generated text produced by an AI service. The basic flow would be: Text generated by an AI service Text converted to speech using a TTS engine An avatar (2D or 3D) rendered in the app that animates lip movement synchronized with the speech Ideally the avatar would render locally on the device. Questions: What Apple frameworks would be most appropriate for implementing a speaking avatar? SceneKit RealityKit SpriteKit (for 2D avatars) Is there any recommended way to drive lip-sync animation from speech audio using Apple frameworks? Does AVSpeechSynthesizer expose phoneme or viseme timing information that could be used for avatar animation? If such timing information is not available, what is the recommended approach for synchronizing character mouth animation with speech audio on macOS/iOS? Are there examples of real-time character animat
Replies
0
Boosts
0
Views
867
Activity
Mar ’26
How do you support Preferred Font Size / Dynamic Type on macOS?
On macOS 26, how do you support the Preferred Text Size value as defined in the Accessibility Settings? Historically, Dynamic Type has not been available on macOS. However, the user has some control over text size through the Accessibility Settings. On macOS 26, a small subset of applications are honouring changes to that value include Finder, Mail, and sidebars in many applications. Dynamic sizing in table views has been available on macOS for awhile. But Mail.app, in particular, is also adjusting the font sizes used in the message's body pane while the Finder is adjusting font sizes used for Desktop icons. I can't find an NSNotification that is fired when the user adjusts the Accessibility Text Size slider, nor can I find an API to read the current value. NSFont.preferredFont(forTextStyle:options:) looks promising but the fonts returned do not appear to take the user's Accessibility setting into account. (Nor do they update dynamically.) SwiftUI's Text(Apple).font(.body) performs similarly to NSFon
Replies
2
Boosts
0
Views
564
Activity
Mar ’26
Swift compiler fails in Release (-O) when using generic ObservableObject with @Published on iOS < 26 in Xcode 26.3
When building a SwiftUI project in Xcode 26.3, Swift compilation fails in the Release configuration with Optimization Level set to -O, when the iOS deployment target is lower than iOS 26 (e.g. iOS 16, 17, or 18). The failure occurs when using a generic class conforming to ObservableObject that contains a @Published property. The same code: Compiles successfully in Xcode 16.3 (Release, -O) with iOS 16/17/18 Compiles successfully in Xcode 26.x when the deployment target is set to iOS 26 Compiles successfully in Xcode 26.x Debug configuration (-Onone) Compiles successfully in Xcode 26.x Release when optimization is disabled (-Onone) However, in Xcode 26.3, the build consistently fails in Release (-O) when targeting iOS 16, 17, or 18. This appears to be a Swift compiler optimization issue related to generics, ObservableObject, @Published, and back-deployment to iOS versions prior to iOS 26. STEPS TO REPRODUCE Create a new SwiftUI App project using Xcode 26.3. Leave all project settings at defaul
Replies
3
Boosts
0
Views
340
Activity
Mar ’26
Reply to Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
For UIKit, isDarkerSystemColorsEnabled indicates whether Increase Contrast is active. To receive updates when this setting changes, observe darkerSystemColorsStatusDidChangeNotification. For AppKit, the accessibilityDisplayShouldIncreaseContrast property indicates if a high-contrast user interface should be presented. Apps can register accessibilityDisplayOptionsDidChangeNotification to respond to changes in this setting Lastly, SwiftUI has colorSchemeContrast, an environment value that provides information on whether standard or increased contrast applies to a view. SwiftUI automatically updates this value when the contrast changes, redrawing views that depend on it. I encourage you to share your workarounds here, as well as file separate bug reports against each app that displays incorrectly. Once complete, post those FB numbers in this thread and I will make sure they get the correct eyes on them. Thank you.  Travis
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to Dumb noob question,,
I heard several years ago that there is a software package or equivalent that lets you create a SwiftUI screen design based a Figma submission.
Replies
Boosts
Views
Activity
Mar ’26
Reply to Sandbox subscription test is triggering multiple transaction events for a single purchase attempt
It's hard to say even a word since you don't show a single line of code. We don't know whether you are using UIKit or SwiftUI, showing a list of subscription plans with UITableView, UICollectionView or SwiftUI List or SwiftUI Table. There is zero information.
Replies
Boosts
Views
Activity
Mar ’26
Increase Contrast reduces List selection contrast in dark appearance in SwiftUI NavigationSplitView
[Submitted as FB22200608] With Increase Contrast turned on, the selected row highlight in a List behaves inconsistently between light and dark appearance on iPad. In light appearance the blue selection highlight correctly becomes darker, but in dark appearance it becomes lighter instead. The text contrast ratio drops from about 3:1 to about 1.5:1, well below accessibility guidelines. This reproduces both in the simulator and on a physical device. The sample uses a standard SwiftUI List inside NavigationSplitView with built-in selection styling. No custom colors or styling are applied. REPRO STEPS Create a new Multiplatform project. Replace ContentView with code below. Build and run on iPad. Select an item in the list. Turn on Dark appearance (Cmd-Shift-A in Simulator). Turn on Increase Contrast (Cmd-Control-Shift-A in Simulator). Observe the selected row highlight. ACTUAL In light appearance, the blue selection highlight becomes darker when Increase Contrast is on, improving contrast as expected. In
Replies
5
Boosts
0
Views
628
Activity
Mar ’26
ScrollView hicjacking focus in swiftui
Greetings! I'm facing a problem handleling full keyboard access in my app. This is a simpler version of the code: struct PrimerTest: View { @FocusState private var focusedImage: Int? var body: some View { VStack(alignment: .leading, spacing: 20) { Link(Go to google or smth, destination: URL(string: https://google.com)!) .font(.headline) Text(First text) Text(Second text) HStack { Text(Label) .accessibilityHidden(true) Spacer() Button(Play) { print(Im a button) } } Text(Selecciona un perfil con el teclado (Tab):) .font(.caption) .foregroundColor(.secondary) HStack { ForEach(0..<5, id: .self) { index in Image(systemName: person.circle.fill) .resizable() .frame(width: 30, height: 30) .focusable(true) .focused($focusedImage, equals: index) .foregroundStyle(focusedImage == index ? Color.blue : Color.gray) .scaleEffect(focusedImage == index ? 1.2 : 1.0) .animation(.easeInOut, value: focusedImage) .accessibilityHidden(true) } } } .navigationTitle(Title n stuff) .padding() } } And the focus behaves as expected and
Replies
2
Boosts
0
Views
1k
Activity
Mar ’26
ShareLink "Save Image" action dismisses presenting view after saving
When using ShareLink in SwiftUI to share an image, the “Save Image” action dismisses not only the share sheet but also the presenting SwiftUI view. The behavior differs depending on whether the photo library permission alert appears. Observed behavior: The first time the user taps Save Image, the system permission alert appears. After granting permission, the image saves successfully and the share sheet dismisses normally. On subsequent attempts, the image is saved successfully, but both the share sheet and the presenting view are dismissed unexpectedly. Expected behavior: After saving the image, only the share sheet should dismiss. The presenting SwiftUI view should remain visible. Steps to Reproduce Present a SwiftUI view using .sheet. Inside that view, add a ShareLink configured to export a PNG image using Transferable. Tap the ShareLink button. Choose Save Image. Grant permission the first time (if prompted). Repeat the action. Result: On subsequent saves, the share she
Replies
4
Boosts
0
Views
153
Activity
Mar ’26
ShareLink "save Image" action dismiss parent view
ShareLink works fine except for save image action which dismiss the presenting view first time system shows the premission alert so image get saved without any problem but for the next saves image get saved then share sheet dismiss and also presenting view dismiss as well here is a sample code ` internal import System import UniformTypeIdentifiers import SwiftUI struct RootView: View { @State private var isPresented: Bool = false var body: some View { ZStack { Color.white Button(Show parent view) { isPresented = true } } .sheet(isPresented: $isPresented) { ParentView() } } } struct ParentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { ZStack { Color.red.opacity(0.5) } .toolbar { ToolbarItem() { let name = (UUID().uuidString) let image = UIImage(named: after)! return ShareLink( item: ShareableImage(image: image, fileName: name), preview: SharePreview( name, image: Image(uiImage: image) ) ) { Image(uiImage: UIImage(resource: .Icons.share24)) .resizable(
Replies
1
Boosts
0
Views
103
Activity
Mar ’26
iOS 26+ UITabBar unselected item colors not updating with UITabBarAppearance
I'm using UITabBarAppearance to customize my TabBar in a SwiftUI app. The customization works perfectly on iOS 18 and earlier, but after updating to iOS 26, the unselected tab items no longer respect my color settings - they just appear black (they are on a white background).Here's my simplified setup: struct ContentView: View { var body: some View { TabView { Text(Home) .tabItem { Image(systemName: house) Text(Home) } .tag(0) Text(Settings) .tabItem { Image(systemName: gear) Text(Settings) } .tag(1) } .onAppear { setupTabBarAppearance() } } private func setupTabBarAppearance() { let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() // These settings work for selected items itemAppearance.selected.iconColor = .systemBlue itemAppearance.selected.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.systemBlue ] // These settings STOPPED working on iOS 26 for unselected items itemAppearance.normal
Replies
1
Boosts
0
Views
236
Activity
Mar ’26