Search results for

“swiftui”

17,491 results found

Post

Replies

Boosts

Views

Activity

Reply to adjusting navigationTitle based on dynamic type size
Thank you, I will review that session. Yes, this is on iOS. In my app, the SwiftUI navigationTitle was getting truncated at larger sizes. My solve was to shorten it, and add in a subtitle at largest sizes to still convey meaning. private func navigationTitleAbridged(for title: String) -> String { if dynamicTypeSize >= .accessibility2 { return fullSqueeze(title) } if dynamicTypeSize >= .xxxLarge { return halfSqueeze(title) } return title }
Topic: General SubTopic:
Accessibility & Inclusion Q&A
Jun ’26
Reply to Per-Document Locale
Hi TyngJJ, thanks for the question. I can only give some general advices based on your description. You may use the Locale parameter on the LocalizedStringResource type. SwiftUI API like Text use the locale from the current environment automatically. So you can write .environment(.locale; your locale) as well. Let me know if that works for your use case. Feel free to share more about your specific use case.
Topic: Localization SubTopic:
Localization Q&A
Jun ’26
Shared code across multiple extension targets
If the main app isn’t fully SwiftUI, but you also ship native SwiftUI widget extensions, watch complications, and a watchOS app, what’s the recommended way to share models, formatting, and chart logic across those targets without duplicating code?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
35
Jun ’26
Reply to How can an in-ImmersiveSpace menu behave like a regular 2D window in visionOS?
Hey @Sakuya_Izayoi, Can you provide me with more information as to what exactly the content is within this menu? I would strongly encourage you to consider deferring to the system and using a Window or WindowGroup for this behavior. You also might be able to take some learnings from some recently updated and published samples. Take a look at Associating a window with an immersive space and the the Solar System view of Hello World. Do these samples provide the experience you are looking for? If you are able to use a SwiftUI view to accomplish this, that will provide the best user experience for your user. Otherwise you are right to consider looking at ManipulationComponent and BillboardComponent when building this part of your experience. Let me know if this helps, Michael
Topic: Reality Composer Pro SubTopic:
RealityKit & Reality Composer Pro Q&A
Jun ’26
Recommended practice for VoiceOver accessibility label aggregation in UIKit (SwiftUI .combine equivalent)
We are seeking guidance on the Apple-recommended way to handle aggregated accessibility labels in UIKit. When grouping elements into a single accessibility container, we need VoiceOver to read their labels with a natural structural pause, without injecting conversational grammar. SwiftUI handles this automatically and gracefully with .combine, but we need the endorsed UIKit equivalent for complex custom views. The Problem When manually aggregating child labels into a parent's accessibilityLabel in UIKit, VoiceOver behaves inconsistently in non-Latin scripts. For example, if we simply join the strings with a Latin comma (, ), VoiceOver ignores the separator in languages like Arabic or Japanese, reading the aggregated labels as a confusing run-on sentence. What we have considered and tried: NSListFormatter: While it correctly localizes separators, it inappropriately injects list grammar (e.g., adding and before the final item). Since our UI elements are merely spatially grouped on the screen and do not
2
0
891
Jun ’26
How can an in-ImmersiveSpace menu behave like a regular 2D window in visionOS?
I’m building a visionOS app with an ImmersiveSpace, and I want to show a menu or control panel inside that immersive space. The menu would be created as part of the app’s immersive content, for example as a SwiftUI attachment in a RealityView, or as a custom RealityKit entity with UI-like content. What I would like is for this in-space menu to behave more like a regular visionOS 2D window: The user can move the menu naturally. While the menu is being moved, it automatically adjusts its orientation to face the user. It maintains a comfortable apparent size or distance while being repositioned. It avoids awkward angles or unreadable placement. It feels similar to the system-managed behavior of regular 2D windows. My question is: is there a supported way to give an in-ImmersiveSpace menu the same placement and movement behavior as a normal 2D window? More specifically: Is there a built-in component or API that provides window-like movement, billboard-facing behavior, comfortable distance handling, or au
1
0
141
Jun ’26
Reply to Any specific strategies for handling a button within a button, for VO + Voice/Switch Control?
So depending on your layout I have a couple of ideas. Buttons within buttons should already be accessible, through custom actions. The user can use the VoiceOver rotor to select the action that the ellipsis performs. This is generally preferable if you have a list of cards, all with ellipsis buttons in them. This allows the user to quickly navigate between cards without having to land on every ellipsis button. However if it's just one card, you could also use .accessibilityRepresentation to represent these accessibility elements as two sibling buttons. https://developer.apple.com/documentation/swiftui/view/accessibilityrepresentation(representation:)
Topic: General SubTopic:
Accessibility & Inclusion Q&A
Jun ’26
Reply to Validating the output of agentic localization
Hey! Sorry to hear about the vendor, that's some unfortunate disruption for you. Verification is definitely one of the biggest challenges here, but we have a couple of things to suggest (some of which we also cover in our session, Translate your app using agents in Xcode). When it comes to finding functional issues for other languages (truncation issues, clipping issues, etc.), agents have the ability to check a lot of their work using the tools baked right into Xcode, like the ability to render a SwiftUI preview of a view in another language, or to launch and interact with your app in the iOS simulator in another language. As for translation quality, you have a couple of paths you can take. We strongly recommend involving native speakers as testers of your app, either through TestFlight or through any other testing process that you might have. Another thing you can try would be to use different agents from different model providers to perform adversarial review—e.g. you have Claude Agent do your ini
Topic: Localization SubTopic:
Localization Q&A
Jun ’26
In SwiftUI, are there any good ways to set a custom tap target, to ensure it's always 44x44.
for example: Our designers want our Disclosures/Legal info icon, to be 4px from the text. So we end up needing to hack around the view, to make the info tap target exist over the text. without any hacks, if we use a 20x20 icon + 4 padding, the tap target is only 28px wide. the hack in question, usually involves adding paddings + inverted (negative) padding, to increase the tap target, without affecting layout
1
0
718
Jun ’26
Displaying a processed image from AVCaptureVideoDataOutput in a swiftUI view?
What is the recommended way of showing a processed image from AVCaptureVideoDataOutput in a swiftUI view? Currently my chain is AVCaptureVideoDataOutput(SampleBuffer) -> CIImage -> CIFilters -> createCGImage from processed CIImage -> Create swiftUI 'Image' from CGIImage, that is in a view Is there a better way to go from AVCaptureVideoDataOutput to a swiftUI view, with image processing?
2
0
296
Jun ’26
Device Hub unexpectedly quit
I have raised Feedback FB23036084 Just using it on an extremely small app that display six SwiftUI charts. I was just scrolling on a ScrollView of the charts. Th feedback has a link to the app on GitHub, the content of the generate report details and also the output of running xcrun simctl diagnose
0
0
118
Jun ’26
[iOS 27 Beta]: tabBarController(_:shouldSelect:) delegate method silently no longer called — breaking tab selection interception
Summary On iOS 27, tabBarController(:shouldSelect:) — the long-standing UITabBarControllerDelegate method accepting a UIViewController — is no longer invoked when the user taps a tab inside a SwiftUI TabView. Tab selection now routes exclusively through tabBarController(:shouldSelectTab:), the UITab-based variant introduced in iOS 18. Impact Any code that relies on tabBarController(_:shouldSelect:) to: Intercept or prevent tab switches Detect tab reselection Propagate tab-change events to other subsystems (e.g., a JavaScript bridge in a hybrid app) ...will silently stop working on iOS 27. There are no compiler warnings, no deprecation notices, and no runtime assertions — the method simply is no longer called. This affected react-native-bottom-tabs, a widely used open-source library, causing all tab screens beyond the first to render as blank/white after any tab tap (see: https://github.com/callstack/react-native-bottom-tabs/issues/529). The workaround is to implement tabBarController(_:shouldSelectTa
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
312
Jun ’26
tvOS SwiftUI App Bugfixes
Hi :-) I need some advice to fix the following issues in SwiftUI. I don't have the source code myself, but I'd like to help the programmer fix the problem quickly. So I'm looking for a few lines of Example-Code that I can show these Code-Lines to help resolve this quickly. 1. Jumping shadow when swiping => The Shadow under the Genre.Buttons jumps when you swipe through them. 2. Liquid Glass Flicker => The Liquid Glass EDGE on a poster or on the buttons flickers (abruptly disappear) when switching from one page to another Can someone help me? Bets regards, Christian :)
0
0
278
Jun ’26
Reply to adjusting navigationTitle based on dynamic type size
Thank you, I will review that session. Yes, this is on iOS. In my app, the SwiftUI navigationTitle was getting truncated at larger sizes. My solve was to shorten it, and add in a subtitle at largest sizes to still convey meaning. private func navigationTitleAbridged(for title: String) -> String { if dynamicTypeSize >= .accessibility2 { return fullSqueeze(title) } if dynamicTypeSize >= .xxxLarge { return halfSqueeze(title) } return title }
Topic: General SubTopic:
Accessibility & Inclusion Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to Per-Document Locale
Hi TyngJJ, thanks for the question. I can only give some general advices based on your description. You may use the Locale parameter on the LocalizedStringResource type. SwiftUI API like Text use the locale from the current environment automatically. So you can write .environment(.locale; your locale) as well. Let me know if that works for your use case. Feel free to share more about your specific use case.
Topic: Localization SubTopic:
Localization Q&A
Replies
Boosts
Views
Activity
Jun ’26
Shared code across multiple extension targets
If the main app isn’t fully SwiftUI, but you also ship native SwiftUI widget extensions, watch complications, and a watchOS app, what’s the recommended way to share models, formatting, and chart logic across those targets without duplicating code?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
35
Activity
Jun ’26
Reply to How can an in-ImmersiveSpace menu behave like a regular 2D window in visionOS?
Hey @Sakuya_Izayoi, Can you provide me with more information as to what exactly the content is within this menu? I would strongly encourage you to consider deferring to the system and using a Window or WindowGroup for this behavior. You also might be able to take some learnings from some recently updated and published samples. Take a look at Associating a window with an immersive space and the the Solar System view of Hello World. Do these samples provide the experience you are looking for? If you are able to use a SwiftUI view to accomplish this, that will provide the best user experience for your user. Otherwise you are right to consider looking at ManipulationComponent and BillboardComponent when building this part of your experience. Let me know if this helps, Michael
Topic: Reality Composer Pro SubTopic:
RealityKit & Reality Composer Pro Q&A
Replies
Boosts
Views
Activity
Jun ’26
Recommended practice for VoiceOver accessibility label aggregation in UIKit (SwiftUI .combine equivalent)
We are seeking guidance on the Apple-recommended way to handle aggregated accessibility labels in UIKit. When grouping elements into a single accessibility container, we need VoiceOver to read their labels with a natural structural pause, without injecting conversational grammar. SwiftUI handles this automatically and gracefully with .combine, but we need the endorsed UIKit equivalent for complex custom views. The Problem When manually aggregating child labels into a parent's accessibilityLabel in UIKit, VoiceOver behaves inconsistently in non-Latin scripts. For example, if we simply join the strings with a Latin comma (, ), VoiceOver ignores the separator in languages like Arabic or Japanese, reading the aggregated labels as a confusing run-on sentence. What we have considered and tried: NSListFormatter: While it correctly localizes separators, it inappropriately injects list grammar (e.g., adding and before the final item). Since our UI elements are merely spatially grouped on the screen and do not
Replies
2
Boosts
0
Views
891
Activity
Jun ’26
How can an in-ImmersiveSpace menu behave like a regular 2D window in visionOS?
I’m building a visionOS app with an ImmersiveSpace, and I want to show a menu or control panel inside that immersive space. The menu would be created as part of the app’s immersive content, for example as a SwiftUI attachment in a RealityView, or as a custom RealityKit entity with UI-like content. What I would like is for this in-space menu to behave more like a regular visionOS 2D window: The user can move the menu naturally. While the menu is being moved, it automatically adjusts its orientation to face the user. It maintains a comfortable apparent size or distance while being repositioned. It avoids awkward angles or unreadable placement. It feels similar to the system-managed behavior of regular 2D windows. My question is: is there a supported way to give an in-ImmersiveSpace menu the same placement and movement behavior as a normal 2D window? More specifically: Is there a built-in component or API that provides window-like movement, billboard-facing behavior, comfortable distance handling, or au
Replies
1
Boosts
0
Views
141
Activity
Jun ’26
Reply to Any specific strategies for handling a button within a button, for VO + Voice/Switch Control?
So depending on your layout I have a couple of ideas. Buttons within buttons should already be accessible, through custom actions. The user can use the VoiceOver rotor to select the action that the ellipsis performs. This is generally preferable if you have a list of cards, all with ellipsis buttons in them. This allows the user to quickly navigate between cards without having to land on every ellipsis button. However if it's just one card, you could also use .accessibilityRepresentation to represent these accessibility elements as two sibling buttons. https://developer.apple.com/documentation/swiftui/view/accessibilityrepresentation(representation:)
Topic: General SubTopic:
Accessibility & Inclusion Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to Validating the output of agentic localization
Hey! Sorry to hear about the vendor, that's some unfortunate disruption for you. Verification is definitely one of the biggest challenges here, but we have a couple of things to suggest (some of which we also cover in our session, Translate your app using agents in Xcode). When it comes to finding functional issues for other languages (truncation issues, clipping issues, etc.), agents have the ability to check a lot of their work using the tools baked right into Xcode, like the ability to render a SwiftUI preview of a view in another language, or to launch and interact with your app in the iOS simulator in another language. As for translation quality, you have a couple of paths you can take. We strongly recommend involving native speakers as testers of your app, either through TestFlight or through any other testing process that you might have. Another thing you can try would be to use different agents from different model providers to perform adversarial review—e.g. you have Claude Agent do your ini
Topic: Localization SubTopic:
Localization Q&A
Replies
Boosts
Views
Activity
Jun ’26
adjusting navigationTitle based on dynamic type size
I've found myself chasing my tail trying to programmatically adjust my .navigationTitle in SwiftUI so it doesn't get truncated given various dynamic type classes mixed with various device widths... Any guidance here on how to think about adjusting Ul copy based on AX type size constraints?
Replies
4
Boosts
0
Views
893
Activity
Jun ’26
Any specific strategies for handling a button within a button, for VO + Voice/Switch Control?
For example, we have a card view that navigates to a comprehensive detail screen... But there's an ellipsis on the card as well, that shows a menu of quick actions. We need both to be tappable. (SwiftUI project)
Replies
2
Boosts
0
Views
746
Activity
Jun ’26
In SwiftUI, are there any good ways to set a custom tap target, to ensure it's always 44x44.
for example: Our designers want our Disclosures/Legal info icon, to be 4px from the text. So we end up needing to hack around the view, to make the info tap target exist over the text. without any hacks, if we use a 20x20 icon + 4 padding, the tap target is only 28px wide. the hack in question, usually involves adding paddings + inverted (negative) padding, to increase the tap target, without affecting layout
Replies
1
Boosts
0
Views
718
Activity
Jun ’26
Displaying a processed image from AVCaptureVideoDataOutput in a swiftUI view?
What is the recommended way of showing a processed image from AVCaptureVideoDataOutput in a swiftUI view? Currently my chain is AVCaptureVideoDataOutput(SampleBuffer) -> CIImage -> CIFilters -> createCGImage from processed CIImage -> Create swiftUI 'Image' from CGIImage, that is in a view Is there a better way to go from AVCaptureVideoDataOutput to a swiftUI view, with image processing?
Replies
2
Boosts
0
Views
296
Activity
Jun ’26
Device Hub unexpectedly quit
I have raised Feedback FB23036084 Just using it on an extremely small app that display six SwiftUI charts. I was just scrolling on a ScrollView of the charts. Th feedback has a link to the app on GitHub, the content of the generate report details and also the output of running xcrun simctl diagnose
Replies
0
Boosts
0
Views
118
Activity
Jun ’26
[iOS 27 Beta]: tabBarController(_:shouldSelect:) delegate method silently no longer called — breaking tab selection interception
Summary On iOS 27, tabBarController(:shouldSelect:) — the long-standing UITabBarControllerDelegate method accepting a UIViewController — is no longer invoked when the user taps a tab inside a SwiftUI TabView. Tab selection now routes exclusively through tabBarController(:shouldSelectTab:), the UITab-based variant introduced in iOS 18. Impact Any code that relies on tabBarController(_:shouldSelect:) to: Intercept or prevent tab switches Detect tab reselection Propagate tab-change events to other subsystems (e.g., a JavaScript bridge in a hybrid app) ...will silently stop working on iOS 27. There are no compiler warnings, no deprecation notices, and no runtime assertions — the method simply is no longer called. This affected react-native-bottom-tabs, a widely used open-source library, causing all tab screens beyond the first to render as blank/white after any tab tap (see: https://github.com/callstack/react-native-bottom-tabs/issues/529). The workaround is to implement tabBarController(_:shouldSelectTa
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
4
Boosts
0
Views
312
Activity
Jun ’26
tvOS SwiftUI App Bugfixes
Hi :-) I need some advice to fix the following issues in SwiftUI. I don't have the source code myself, but I'd like to help the programmer fix the problem quickly. So I'm looking for a few lines of Example-Code that I can show these Code-Lines to help resolve this quickly. 1. Jumping shadow when swiping => The Shadow under the Genre.Buttons jumps when you swipe through them. 2. Liquid Glass Flicker => The Liquid Glass EDGE on a poster or on the buttons flickers (abruptly disappear) when switching from one page to another Can someone help me? Bets regards, Christian :)
Replies
0
Boosts
0
Views
278
Activity
Jun ’26