Search results for

“swiftui”

17,109 results found

Post

Replies

Boosts

Views

Activity

Reply to Distributing In House Apps via my OWN website
Maybe back up a bit. To distribute iOS apps to internal users of your organization, you need to have an Enterprise Developer account. You can then distribute your iOS apps via your own internal website, as described here: https://support.apple.com/guide/deployment/depce7cefc4d/web I don't have an Enterprise account, so that's all I can say about it. It sounds like you are trying to run iOS apps on your Macs. You can certainly do that. However, that is a feature designed for end users' convenience. From a developer's perspective, it isn't more convenient. You can bypass the complications of the Enterprise account by developing Mac-native apps. Then you can distribute them on your own website as DTS Engineer describes. The difficulty here is going to be how you develop the iOS apps. If you are developing stand-alone apps, you could use SwiftUI or the Mac Catalyst framework to built Mac apps using cross-platform or iOS APIs. But if you are using some 3rd party tool to build your iOS apps, then you'll ha
Apr ’26
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
Yeah, this looks like a bug in SwiftUI Text, and so thanks for filing the feedback report. Not sure if this is appropriate to your UI, but as a potential workaround, you can try to wrap your Text with ScrollView, which I believe should give the Text enough space and avoid the truncation. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
Reply to How to change app language on App Store Connect?
The value of the Languages field in the App Store is determined by the existence of the .lproj folders in your app bundle. When you add a localization for your app using Xcode, Xcode automatically adds the corresponding .lproj folder to your app bundle. Concretely, if you add the Italian localization to your app, localize the resources, and submit the new version to App Store, App Store will detect that your app supports Italian, and add Italian to the Languages field. For more information about how to localize your app, see Localizing and varying text with a string catalog, assuming that you are using SwiftUI + String catalog, the modern techniques. Note that, for Xcode to generate the .lproj folder, you need to localize the strings, and not just add the language. (For apps that don't use .lproj folders to manage localized resources, the system infers the support languages from the values of the CFBundleLocalizations key in their Info.plist.) Best, —— Ziqiao Chen  Worldwide Developer Relations.
Apr ’26
Reply to RealityView attachment draw order
Hey @drewolbrich, I took another look at the provided sample code project and if I understand things correctly, I don't think you need to control the draw order of the individual attachments. You have a non-coplanar scene and need to inform the system to either draw the model in front or behind your SwiftUI layers. You can use planarUIAlwaysBehind to instruct the renderer to draw a model’s mesh behind the SwiftUI layer that’s coincident with the mesh. I performed the following change on your sample and fixed the issue: - private let modelSortGroup = ModelSortGroup(depthPass: .prePass) + private let modelSortGroup = ModelSortGroup.planarUIAlwaysBehind Can you try this and let me know if this works in your app? If not could you provide an updated sample project that illustrates the issue using ModelSortGroup.PlanarUIPlacement to control the drawing order of SwiftUI views. The best way to ask for documentation is by submitting feedback request and posting to the developer forums limiti
Topic: Spatial Computing SubTopic: General Tags:
Apr ’26
DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi I am trying to implement a minimal DeviceActivityReport extension. Setup: iOS app with FamilyControls authorization (status = approved) DeviceActivityReport displayed in SwiftUI Report extension embedded in PlugIns Correct NSExtensionPointIdentifier: com.apple.deviceactivityui.report-extension No NSExtensionPrincipalClass or storyboard Entitlements: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage The app installs and runs correctly. Authorization is granted. However, the extension is never loaded: No logs from the extension (init/body/makeConfiguration never called) Console shows: Failed to discover the client's extension: DeviceActivityReportService... ClientError Code=2 Environment: Xcode 16.2 iOS device running iOS 18.x (latest available) The .appex is correctly embedded and signed. Question: Is there a known issue with DeviceActivityReport extensions not being discovered at runtime with this setup? Is additional configuration required beyond NSExte
2
0
288
Apr ’26
How to Indicate Selected State for a Menu Toolbar Item (Filter) in SwiftUI?
hi, On my page’s toolbar, I have a toolbar item that is implemented as a menu. Its purpose is to filter the content displayed on the page, similar to the filtering feature in the Photos app. When a user selects a filter option, I want the toolbar item to appear highlighted to indicate the active state. I came across the following guidance in the Human Interface Guidelines: Provide a selected-state version of an interface icon only if necessary. You don’t need to provide selected and unselected appearances for an icon that’s used in standard system components such as toolbars, tab bars, and buttons. The system updates the visual appearance of the selected state automatically. An image of two toolbar buttons that share a background. The left button shows the Filter icon in a selected state, using a blue tint color for its background. The right button shows the More icon in an unselected state, using the default appearance for toolbar buttons. In a toolbar, a selected icon receives the app’s accent color. Howeve
Topic: UI Frameworks SubTopic: SwiftUI
0
0
127
Apr ’26
Reply to popoverTips don't display for toolbar menu buttons in iOS 26.1
This is the workaround that I am currently using, which is just using TipKit's model to drive a popover(). Note that these popovers, in iOS 26, use the iOS 26 LiquidGlass morphing-button popover style. import SwiftUI import TipKit extension View { func popoverTipWorkaround(_ tip: some Tip) -> some View { modifier(PopoverTipWorkaround(tip: tip)) } } private struct PopoverTipWorkaround: ViewModifier { let tip: T @State private var shouldDisplay = false func body(content: Content) -> some View { content .popover(isPresented: $shouldDisplay) { TipView(tip) .tipViewStyle(NoDismissTipStyle()) .tipBackground(.clear) .presentationCompactAdaptation(.popover) } .task { for await status in tip.statusUpdates { if status == .available { shouldDisplay = true } } } } } private struct NoDismissTipStyle: TipViewStyle { func makeBody(configuration: Configuration) -> some View { VStack(alignment: .leading) { configuration.title configuration.message } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
Thank-you for your reply. First, I want to re-iterate that the application appears run correctly and the difficulty is only with the XCUITest part. That of course does not mean that the application is put together correctly, only that it seems to work for me. I did use an explicit co-ordinate space. My SwiftUI Canvas structure employed the .coordinateSpace modifier with a .named(...) parameter specifying a character string constant. My DragGesture also used the same .named(...) parameter; as do my MagnifyGesture and my SpatialTapGesture. I'll change the code to use .local for the gesture definitions and remove the modifier to the Canvas structure. It is also the case that my Canvas structure employs an animation modifier .animation(.interactiveSpring, value: currentOffset) Did you also animate the drag in your test application? The view hierarchy is: - NavigationStack -- VStack --- Spacer --- Text --- HStack ---- Text ---- Text ---- Text ---- Text --- Text --- Spacer --- GeometryReader ---- Canvas --
Apr ’26
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regi
10
0
634
Apr ’26
Previews crash after making change to Swift Package version
Previews seemed to be working okay. However, I wanted to test out some changes inside of a package that I'm working on for work, but in a lighter project since in our main project (where I have the package pulled in locally for now) is just too big to have the previews render in a decent amount of time. So, I opened a small project that was already importing that package and was set to 'Up to Next Major', but I switched that to 'branch' and added my branch. This is the second time I've done that and it causes Xcode to freak out in terms of the previews. This is the code I have: import SwiftUI extension EnvironmentValues { @Entry var trailingDescriptionColorToken: Color = .secondary } extension View { func updateTrailingDescriptionColor(to colorToken: Color, when trigger: Bool) -> some View { environment(.trailingDescriptionColorToken, trigger ? colorToken : .secondary) } } // MARK: - ListItemDescription public struct ListItemDescription: View { @Environment(.trailingDescriptionColorToken) var trai
0
0
58
Apr ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
I built a test project with a SwiftUI Canvas that draws a simple network graph and pans via a DragGesture. I added UI tests that use XCUICoordinate.press(forDuration:thenDragTo:) with various drag distances and compared the requested distance against the content offset the app reported. In every case the values matched 1:1 — a 200-point drag moved the content exactly 200 points. This suggests the mismatch you're seeing is specific to your view hierarchy or how you apply the drag translation. A few things to check: Scale transforms: If you apply a scale to the Canvas or a parent view (for example, pinch-to-zoom), the gesture translation arrives in screen points while the content moves in scaled coordinates. A 2x scale would make the content appear to move twice as far as expected. Coordinate space: If your DragGesture specifies a coordinateSpace other than .local, the translation values are reported in that space, which may not match the Canvas coordinate system. Nested scroll views or gesture-interce
Apr ’26
Reply to segmented picker style causes runtime warning
Thanks so much for this very interesting post. I used the latest beta of Xcode and I do not see this warning with Version 26.5 beta 2. I believe, but haven’t seen this before, maybe a known issue in SwiftUI on macOS. It occurs because of how SwiftUI bridges AppKit's NSSegmentedControl to the .segmented picker style. That's why changing it to .automatic does not provide you this warning. But please do try the latest beta. Let me know if you can try that Xcode Version. Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
segmented picker style causes runtime warning
On OSX, using a segmented picker style causes the following warning to be emitted (when a different selection is made) : Publishing changes from within view updates is not allowed, this will cause undefined behavior. The warning is not emitted using the 'Preview Canvas' only when running the app. Changing the picker style to automatic also fixes it, but the segmented style is used extensively. Tested using XCode 26.4.1 on MacOS 26.3.1 --- view --- import SwiftUI internal import Combine enum Mode : String { case one, two, three } class MyObject : ObservableObject { @Published var mode : Mode = .one } struct ContentView: View { @StateObject var obj = MyObject() var body: some View { VStack { Picker(Mode,selection: $obj.mode) { Text(One).tag(Mode.one) Text(Two).tag(Mode.two) Text(Three).tag(Mode.three) } .pickerStyle(.segmented) } .padding() } } #Preview { ContentView() } --- app --- import SwiftUI @main struct SwiftUIBugApp: App { var body: some Scene { WindowGroup { ContentView() } } }
6
0
101
Apr ’26
Reply to SwiftUI bottom bar triggers UIKitToolbar hierarchy fault and constraint errors
import SwiftUI struct ContentView: View { var body: some View { NavigationStack { Text(XX) .toolbar { ToolbarItem(placement: .bottomBar) { Text(YY) } } } } } Here is an even simpler ContentView that demonstrates the same error. This occurs for both iOS 26.4 and iPadOS 26.4 The output generated in the Xcode console is: 'UIKitToolbar' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’26
Reply to Distributing In House Apps via my OWN website
Maybe back up a bit. To distribute iOS apps to internal users of your organization, you need to have an Enterprise Developer account. You can then distribute your iOS apps via your own internal website, as described here: https://support.apple.com/guide/deployment/depce7cefc4d/web I don't have an Enterprise account, so that's all I can say about it. It sounds like you are trying to run iOS apps on your Macs. You can certainly do that. However, that is a feature designed for end users' convenience. From a developer's perspective, it isn't more convenient. You can bypass the complications of the Enterprise account by developing Mac-native apps. Then you can distribute them on your own website as DTS Engineer describes. The difficulty here is going to be how you develop the iOS apps. If you are developing stand-alone apps, you could use SwiftUI or the Mac Catalyst framework to built Mac apps using cross-platform or iOS APIs. But if you are using some 3rd party tool to build your iOS apps, then you'll ha
Replies
Boosts
Views
Activity
Apr ’26
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
Yeah, this looks like a bug in SwiftUI Text, and so thanks for filing the feedback report. Not sure if this is appropriate to your UI, but as a potential workaround, you can try to wrap your Text with ScrollView, which I believe should give the Text enough space and avoid the truncation. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to How to change app language on App Store Connect?
The value of the Languages field in the App Store is determined by the existence of the .lproj folders in your app bundle. When you add a localization for your app using Xcode, Xcode automatically adds the corresponding .lproj folder to your app bundle. Concretely, if you add the Italian localization to your app, localize the resources, and submit the new version to App Store, App Store will detect that your app supports Italian, and add Italian to the Languages field. For more information about how to localize your app, see Localizing and varying text with a string catalog, assuming that you are using SwiftUI + String catalog, the modern techniques. Note that, for Xcode to generate the .lproj folder, you need to localize the strings, and not just add the language. (For apps that don't use .lproj folders to manage localized resources, the system infers the support languages from the values of the CFBundleLocalizations key in their Info.plist.) Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
Apr ’26
Reply to RealityView attachment draw order
Hey @drewolbrich, I took another look at the provided sample code project and if I understand things correctly, I don't think you need to control the draw order of the individual attachments. You have a non-coplanar scene and need to inform the system to either draw the model in front or behind your SwiftUI layers. You can use planarUIAlwaysBehind to instruct the renderer to draw a model’s mesh behind the SwiftUI layer that’s coincident with the mesh. I performed the following change on your sample and fixed the issue: - private let modelSortGroup = ModelSortGroup(depthPass: .prePass) + private let modelSortGroup = ModelSortGroup.planarUIAlwaysBehind Can you try this and let me know if this works in your app? If not could you provide an updated sample project that illustrates the issue using ModelSortGroup.PlanarUIPlacement to control the drawing order of SwiftUI views. The best way to ask for documentation is by submitting feedback request and posting to the developer forums limiti
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’26
DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi I am trying to implement a minimal DeviceActivityReport extension. Setup: iOS app with FamilyControls authorization (status = approved) DeviceActivityReport displayed in SwiftUI Report extension embedded in PlugIns Correct NSExtensionPointIdentifier: com.apple.deviceactivityui.report-extension No NSExtensionPrincipalClass or storyboard Entitlements: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage The app installs and runs correctly. Authorization is granted. However, the extension is never loaded: No logs from the extension (init/body/makeConfiguration never called) Console shows: Failed to discover the client's extension: DeviceActivityReportService... ClientError Code=2 Environment: Xcode 16.2 iOS device running iOS 18.x (latest available) The .appex is correctly embedded and signed. Question: Is there a known issue with DeviceActivityReport extensions not being discovered at runtime with this setup? Is additional configuration required beyond NSExte
Replies
2
Boosts
0
Views
288
Activity
Apr ’26
How to Indicate Selected State for a Menu Toolbar Item (Filter) in SwiftUI?
hi, On my page’s toolbar, I have a toolbar item that is implemented as a menu. Its purpose is to filter the content displayed on the page, similar to the filtering feature in the Photos app. When a user selects a filter option, I want the toolbar item to appear highlighted to indicate the active state. I came across the following guidance in the Human Interface Guidelines: Provide a selected-state version of an interface icon only if necessary. You don’t need to provide selected and unselected appearances for an icon that’s used in standard system components such as toolbars, tab bars, and buttons. The system updates the visual appearance of the selected state automatically. An image of two toolbar buttons that share a background. The left button shows the Filter icon in a selected state, using a blue tint color for its background. The right button shows the More icon in an unselected state, using the default appearance for toolbar buttons. In a toolbar, a selected icon receives the app’s accent color. Howeve
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
127
Activity
Apr ’26
Reply to popoverTips don't display for toolbar menu buttons in iOS 26.1
This is the workaround that I am currently using, which is just using TipKit's model to drive a popover(). Note that these popovers, in iOS 26, use the iOS 26 LiquidGlass morphing-button popover style. import SwiftUI import TipKit extension View { func popoverTipWorkaround(_ tip: some Tip) -> some View { modifier(PopoverTipWorkaround(tip: tip)) } } private struct PopoverTipWorkaround: ViewModifier { let tip: T @State private var shouldDisplay = false func body(content: Content) -> some View { content .popover(isPresented: $shouldDisplay) { TipView(tip) .tipViewStyle(NoDismissTipStyle()) .tipBackground(.clear) .presentationCompactAdaptation(.popover) } .task { for await status in tip.statusUpdates { if status == .available { shouldDisplay = true } } } } } private struct NoDismissTipStyle: TipViewStyle { func makeBody(configuration: Configuration) -> some View { VStack(alignment: .leading) { configuration.title configuration.message } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
Thank-you for your reply. First, I want to re-iterate that the application appears run correctly and the difficulty is only with the XCUITest part. That of course does not mean that the application is put together correctly, only that it seems to work for me. I did use an explicit co-ordinate space. My SwiftUI Canvas structure employed the .coordinateSpace modifier with a .named(...) parameter specifying a character string constant. My DragGesture also used the same .named(...) parameter; as do my MagnifyGesture and my SpatialTapGesture. I'll change the code to use .local for the gesture definitions and remove the modifier to the Canvas structure. It is also the case that my Canvas structure employs an animation modifier .animation(.interactiveSpring, value: currentOffset) Did you also animate the drag in your test application? The view hierarchy is: - NavigationStack -- VStack --- Spacer --- Text --- HStack ---- Text ---- Text ---- Text ---- Text --- Text --- Spacer --- GeometryReader ---- Canvas --
Replies
Boosts
Views
Activity
Apr ’26
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regi
Replies
10
Boosts
0
Views
634
Activity
Apr ’26
Previews crash after making change to Swift Package version
Previews seemed to be working okay. However, I wanted to test out some changes inside of a package that I'm working on for work, but in a lighter project since in our main project (where I have the package pulled in locally for now) is just too big to have the previews render in a decent amount of time. So, I opened a small project that was already importing that package and was set to 'Up to Next Major', but I switched that to 'branch' and added my branch. This is the second time I've done that and it causes Xcode to freak out in terms of the previews. This is the code I have: import SwiftUI extension EnvironmentValues { @Entry var trailingDescriptionColorToken: Color = .secondary } extension View { func updateTrailingDescriptionColor(to colorToken: Color, when trigger: Bool) -> some View { environment(.trailingDescriptionColorToken, trigger ? colorToken : .secondary) } } // MARK: - ListItemDescription public struct ListItemDescription: View { @Environment(.trailingDescriptionColorToken) var trai
Replies
0
Boosts
0
Views
58
Activity
Apr ’26
Reply to Disabling font Anti-Aliasing in a Text in SwiftUI
Thank you for filing the feedback report, and that's a creative solution. Using a stitchable Metal shader with .colorEffect() to threshold the alpha is an elegant way to strip the anti-aliased fringe while staying entirely within SwiftUI's rendering pipeline. The results in your screenshot look great.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
I built a test project with a SwiftUI Canvas that draws a simple network graph and pans via a DragGesture. I added UI tests that use XCUICoordinate.press(forDuration:thenDragTo:) with various drag distances and compared the requested distance against the content offset the app reported. In every case the values matched 1:1 — a 200-point drag moved the content exactly 200 points. This suggests the mismatch you're seeing is specific to your view hierarchy or how you apply the drag translation. A few things to check: Scale transforms: If you apply a scale to the Canvas or a parent view (for example, pinch-to-zoom), the gesture translation arrives in screen points while the content moves in scaled coordinates. A 2x scale would make the content appear to move twice as far as expected. Coordinate space: If your DragGesture specifies a coordinateSpace other than .local, the translation values are reported in that space, which may not match the Canvas coordinate system. Nested scroll views or gesture-interce
Replies
Boosts
Views
Activity
Apr ’26
Reply to segmented picker style causes runtime warning
Thanks so much for this very interesting post. I used the latest beta of Xcode and I do not see this warning with Version 26.5 beta 2. I believe, but haven’t seen this before, maybe a known issue in SwiftUI on macOS. It occurs because of how SwiftUI bridges AppKit's NSSegmentedControl to the .segmented picker style. That's why changing it to .automatic does not provide you this warning. But please do try the latest beta. Let me know if you can try that Xcode Version. Albert
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26
segmented picker style causes runtime warning
On OSX, using a segmented picker style causes the following warning to be emitted (when a different selection is made) : Publishing changes from within view updates is not allowed, this will cause undefined behavior. The warning is not emitted using the 'Preview Canvas' only when running the app. Changing the picker style to automatic also fixes it, but the segmented style is used extensively. Tested using XCode 26.4.1 on MacOS 26.3.1 --- view --- import SwiftUI internal import Combine enum Mode : String { case one, two, three } class MyObject : ObservableObject { @Published var mode : Mode = .one } struct ContentView: View { @StateObject var obj = MyObject() var body: some View { VStack { Picker(Mode,selection: $obj.mode) { Text(One).tag(Mode.one) Text(Two).tag(Mode.two) Text(Three).tag(Mode.three) } .pickerStyle(.segmented) } .padding() } } #Preview { ContentView() } --- app --- import SwiftUI @main struct SwiftUIBugApp: App { var body: some Scene { WindowGroup { ContentView() } } }
Replies
6
Boosts
0
Views
101
Activity
Apr ’26
Reply to SwiftUI bottom bar triggers UIKitToolbar hierarchy fault and constraint errors
import SwiftUI struct ContentView: View { var body: some View { NavigationStack { Text(XX) .toolbar { ToolbarItem(placement: .bottomBar) { Text(YY) } } } } } Here is an even simpler ContentView that demonstrates the same error. This occurs for both iOS 26.4 and iPadOS 26.4 The output generated in the Xcode console is: 'UIKitToolbar' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’26