I’m trying to use the new safeAreaBar() to place a button in the bottom safe area of the view for the main action. However, there’s a bug when the view is inside a NavigationStack: a white or translucent background appears around the button. When I move the view outside of the NavigationStack, the issue goes away.
NavigationStack {
List {
Text("ok")
}
.safeAreaBar(edge: .bottom) {
Button(action: {}, label: {
Text("Continue").font(.headline)
})
.buttonStyle(.glassProminent)
}
}
Is it a known issue?
SwiftUI
RSS for tagProvide views, controls, and layout structures for declaring your app's user interface using SwiftUI.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am confused about the "inheritance" behavior of modifiers in SwiftUI. Some modifiers (such as .background, .clipShape, etc.) seem to affect both parent and child views inconsistently. Here are some specific examples I encountered in Xcode 16.4 with the iOS 18.5 iPhone 16 Pro simulator:
struct ContentView: View {
var body: some View {
VStack { // RedVStack
Text("Hello world!")
VStack { // OrangeVStack
Text("Hello")
Text("Hello")
}
.background(.orange)
}
.background(.red, in: RoundedRectangle(cornerRadius: 5))
// RedVStack has rounded corners, OrangeVStack also has rounded corners
}
}
struct ContentView: View {
var body: some View {
VStack { // RedVStack
Text("Hello world!")
VStack { // OrangeVStack
Text("Hello")
Text("Hello")
}
.background(.orange)
Text("Hello world!")
}
.background(.red, in: RoundedRectangle(cornerRadius: 5))
// RedVStack has rounded corners, OrangeVStack does not have rounded corners
}
}
struct ContentView: View {
var body: some View {
VStack { // RedVStack
Text("Hello world!")
VStack { // OrangeVStack
Text("Hello")
Text("Hello")
}
.background(.orange)
}
.background(.red)
.clipShape(RoundedRectangle(cornerRadius: 5))
// RedVStack has rounded corners, OrangeVStack does not have rounded corners
}
}
I find it difficult to understand which modifiers affect child views and which do not. Is there any official documentation or authoritative explanation that can help me understand the scope and "inheritance" mechanism of SwiftUI modifiers? Thank you!
Hi everyone,
I’ve encountered an issue where using a popover inside the toolbar of a Catalyst app causes a crash on macOS 26 beta 5 with Xcode 26 beta 5. Here’s a simplified code snippet:
import SwiftUI
struct ContentView: View {
@State private var isPresentingPopover = false
var body: some View {
NavigationStack {
VStack {
}
.padding()
.toolbar {
ToolbarItem {
Button(action: { isPresentingPopover.toggle() }) {
Image(systemName: "bubble")
}
.popover(isPresented: $isPresentingPopover) {
Text("Hello")
.font(.largeTitle)
.padding()
}
}
}
}
}
}
Steps to reproduce:
Create a new iOS app using Xcode 26 beta 5.
Enable Mac Catalyst (Match iPad).
Add the above code to show a Popover from a toolbar button.
Run the app on macOS 26, then click the toolbar button.
The app crashes immediately upon clicking the toolbar button.
Has anyone else run into this? Any workarounds or suggestions would be appreciated!
Thanks!
How to obtain the physical memory size of VisionPro and how much memory is currently available
The steps to reproduce this issue are a bit complicated.
In my app, previewing View A in Package P works fine, but another view in the same package fails to preview.
The error message is shown below. It seems that the memory used for the preview is interfering with the shared memory area.
This is reported as FB18519266
Exception Subtype: KERN_PROTECTION_FAILURE at 0x00000003402d8900
Exception Codes: 0x0000000000000002, 0x00000003402d8900
VM Region Info: 0x3402d8900 is in 0x3402c8000-0x340a18000; bytes after start: 67840 bytes before end: 7599871
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
mapped file 3401dc000-3402c8000 [ 944K] r-x/rwx SM=COW Object_id=57e4ac
---> shared memory 3402c8000-340a18000 [ 7488K] rw-/rw- SM=SHM
mapped file 340a18000-340f38000 [ 5248K] r-x/rwx SM=COW Object_id=1dc9a049
Termination Reason: ****** 10 Bus error: 10
Terminating Process: exc handler [94787]
I’m attempting to display a PDF file in a visionOS application using the PDFView in PDFKit.
When running on device with visionOS 26, a horizontal solid line appears on some pages, while on other pages, both a horizontal and vertical solid line appear.
These lines do not appear
in Xcode preview canvas (macOS, visionOS)
on device running visionOS 2.5
on Mac running macOS 15.6
I thought that this could possibly be the page breaks, but setting displaysPageBreaks = false did not appear to be effective.
Are there any other settings that could be causing the lines to display?
Code Example
struct ContentView: View {
@State var pdf: PDFDocument? = nil
var body: some View {
PDFViewWrapper(pdf: pdf)
.padding()
}
}
#Preview(windowStyle: .automatic) {
ContentView(pdf: PDFDocument(url: Bundle.main.url(forResource: "SampleApple", withExtension: "pdf")!))
.environment(AppModel())
}
struct PDFViewWrapper: UIViewRepresentable {
let pdf: PDFDocument?
func makeUIView(context: Context) -> PDFView {
let view = PDFView()
view.document = pdf
view.displaysPageBreaks = false
return view
}
func updateUIView(_ uiView: PDFView, context: Context) {
uiView.document = pdf
}
}
Tested with
Xcode Version 16.4 (16F6)
Xcode Version 26.0 beta 5 (17A5295f)
visionOS 2.5
visionOS 26 Beta 5
I
I want to make an app that has a navigationsplitview with three columns on iPad but a tapbar on iPhone and small iPad windows. How should I do that? Since iOS 18 you can use tabview to make a tabbar on iPhone and a sidebar on iPad, but then you just have two columns. Is there a way to make this possible? Can you make a navigationsplitview sidebar move into a tabbar? And how did you do it before iOS 18 like in the podcasts app?
Topic:
UI Frameworks
SubTopic:
SwiftUI
I'm working on the control widget which should display the SF image on the UI, but I have found that it cannot be displayed stably. I have eight CarCtrlWidgets which is about the type doorLock、chargeCover、frontBox、 locateCarLight、 locateCarHorn、 ventilate、 backBox and airCondition, it should all be showed but sometime they only show the text and placeholder. I'm aware of the images should be custom SF image and I can see them to show perfectly sometimes, but in other time it is just failed. This's really confused me, can anyone help me out?
deviceversion 18.5;device model iPhone 16 pro;
Hello Apple Developer Community: I have a problem with the fullscreencover. I can see the Things, that shouldn’t be visible behind it.
I’m currently developing with iOS 26 and only there it happens.
I hope you can help me :)
Have a nice day
I want a different color, one from my asset catalog, as the background of my first ever swift UI view (and, well, swift, the rest of the app is still obj.c)
I've tried putting the color everywhere, but it does't take. I tried with just .red, too to make sure it wasn't me. Does anyone know where I can put a color call that will actually run? Black looks very out of place in my happy app. I spent a lot of time making a custom dark palette.
TIA
KT
@State private var viewModel = ViewModel()
@State private var showAddSheet = false
var body: some View {
ZStack {
Color.myCuteBg
.ignoresSafeArea(.all)
NavigationStack {
content
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .principal) {
Image("cute.image")
.font(.system(size: 30))
.foregroundColor(.beigeTitle)
}
}
}
.background(Color.myCuteBg)
.presentationBackground(.myCuteBg)
.sheet(isPresented: $showAddSheet) {
AddView()
}
.environment(viewModel)
.onAppear {
viewModel.fetchStuff()
}
}
.tint(.cuteColor)
}
@ViewBuilder var content: some View {
if viewModel.list.isEmpty && viewModel.anotherlist.isEmpty {
ContentUnavailableView(
"No Content",
image: "stop",
description: Text("Add something here by tapping the + button.")
)
} else {
contentList
}
}
var contentList: some View {
blah blah blah
}
}
First I tried the background, then the presentation background, and finally the Zstack. I hope this is fixed because it's actually fun to build scrollable content and text with swiftUI and I'd been avoiding it for years.
Anyone run into this situation?
I am using a TabView for iOS App and also decided to use a ToolbarTitleMenu on a couple of the Main views.
Everything works as expected on iPhone versions of the App because the tabs are displayed along the bottom.
However on iPad they are "floating" in the top middle of the screen and therefore completely obscure the ToolBarTitleMenu selector.
Is there a way to get around this? I am surprised that Apple would have a standard control that does not work well on these two devices. Of course I can do a compiler #IF but would like to know if there is something I am missing here.
Topic:
UI Frameworks
SubTopic:
SwiftUI
With Xcode 26.0 Beta 4 the container concentric API is finally available, which is great!
What I was wondering is how to use this API for button shapes. At the moment it seems that there is no ButtonBorderShape available that would behave like ConcentricRectangle.
Is this intentional or is it expected that with upcoming beta versions we can also use the concentric style as button border shapes? Or is there maybe another way of getting the buttons shape to behave like a concentric shape?
A use case I currently see is having the button as part of a container, using the .bordered button style and then aligning the corners of the button use the concentric style.
Any information about this is highly appreciated. Thank you very much!
The following code causes an error in Xcode 26.0 beta3 in iOS Simulator with iOS 26.0.
After starting the App, scroll to the end of the grid and the app will break.
Testet with Xcode Playground with platforms: [ .iOS("17.0")],
Simplest possible variant:
import SwiftUI
import MapKit
struct ContentView: View {
var body: some View {
NavigationStack {
ScrollView {
LazyVGrid(columns: [GridItem()]) {
ForEach(1...12, id:\.self) { i in
Text("Hello \(i)")
.frame(height: 150)
}
Map { }
.frame(height: 150)
}
}
}
}
}
Thrown error:
Observation tracking feedback loop detected! Make a symbolic breakpoint at UIObservationTrackingFeedbackLoopDetected to catch this in the debugger. Refer to the console logs for details about recent invalidations; you can also make a symbolic breakpoint at UIObservationTrackingInvalidated to catch invalidations in the debugger. Object receiving repeated [updateProperties] invalidations: <UIKit.NavigationBarContentView: 0x103026000; frame = (0 0; 402 54); gestureRecognizers = <NSArray: 0x600000c26790>; layer = <CALayer: 0x600000c2d4a0>> contentView=0x0000000103026000
These three nested views are necessary to reproduce the error: NavigationStack -> ScrollView -> LazyVGrid
In iOS Simulator with iOS 18.0 there is no error message, the CPU raises to 100%.
With Xcode 16.4 the program runs error-free.
Is there a solution?
I'm working with an app that has a structure of a main TabView, where each Tab has its own NavigationStack. A very simplified rendition of the app looks like this:
struct ContentView: View {
var body: some View {
TabView {
Tab("Tab 1", systemImage: "document") {
NavigationStack {
VStack {
Text("Tab 1")
NavigationLink("Load Detail") {
VStack {
Text("Detail View")
}.toolbarVisibility(.hidden, for: .bottomBar, .tabBar)
}
}
}
}
Tab("Tab 2", systemImage: "map") {
NavigationStack {
VStack {
Text("Tab 2")
}
}
}
}.tabViewBottomAccessory {
Button("Action") {}
}
}
}
With this structure, when I load the detail view in the NavigationLink, I see the tab bar hidden as I would expect. Unfortunately, the tabViewBottomAccessory button remains visible. I've taken some steps to try and fix this ( injecting state at different levels that observe the navigation path and try to change the visibility ) but none of those attempts work, and it seems to me that fundamentally, if the tab bar is desired to be hidden, then so also should the tab accessory be hidden.
I didn't find anywhere online that seemed to indicate this was a known bug, so wanted to post this here first to see if this was the behavior that is expected, or worth filing a bug in iOS 26.
[Also submitted as FB19313064]
The .disabled() modifier doesn't visually disable buttons inside a ToolbarItem container on iOS 26.0 (23A5297i) devices. The button looks enabled, but tapping it doesn't trigger the action.
When deployment target is lowered to iOS 18 and deployed to an iOS 18 device, it works correctly. It still fails on an iOS 26 device, even with an iOS 18-targeted build.
This occurs in both the Simulator and on a physical device.
Screen Recording
Code
struct ContentView: View {
@State private var isButtonDisabled = false
private var osTitle: String {
let version = ProcessInfo.processInfo.operatingSystemVersion
return "iOS \(version.majorVersion)"
}
var body: some View {
NavigationStack {
VStack {
Button("Body Button") {
print("Body button tapped")
}
.buttonStyle(.borderedProminent)
.disabled(isButtonDisabled)
Toggle("Disable buttons", isOn: $isButtonDisabled)
Spacer()
}
.padding()
.navigationTitle("Device: \(osTitle)")
.navigationBarTitleDisplayMode(.large)
.toolbar {
ToolbarItem {
Button("Toolbar") {
print("Toolbar button tapped")
}
.buttonStyle(.borderedProminent)
.disabled(isButtonDisabled)
}
}
}
}
}
In this WWDC talk about liquid glass https://developer.apple.com/videos/play/wwdc2025/219/ they mention that there are two variants of liquid glass, regular and clear.
I don't see any way to try the clear variant using the .glassEffect() APIs, they only expose regular, is there some other way to try the clear variant?
as i know, i can add a UIWindowSceneDragInteraction to my view to do this. but how can I achieve the same effect in SwiftUI? Is there a way to do it without relying on UIKit?
How to Hide Unused Menu Items on iPadOS Menu Bar in SwiftUI?
(Xcode 26 beta 4, iPadOS 26 beta 4)
We’re working on adding menu bar support to our SwiftUI app on iPadOS, aiming to provide a more consistent and productive experience across platforms.
We’d like to hide system-provided menu items that aren’t relevant to our app, such as:
Open…
Select All
Customize Toolbar…
New Window, Show All Windows, Open Windows, etc.
Is there a way to control which default items appear in the menu bar?
Feedback ID: FB18792279
How to Enable or Customize Undo/Redo Menu Items on iPadOS Menu Bar in SwiftUI?
(Xcode 26 beta 4, iPadOS 26 beta 4)
We’re working on adding menu bar support to our SwiftUI app on iPadOS, aiming to provide a more consistent and productive experience across platforms.
Our app is a unified iPad/macOS app that uses UndoManager to support undo/redo operations.
However, we’ve run into the following issues:
On macOS, undo and redo work as expected via the menu bar.
On iPadOS, the Undo and Redo menu items are always disabled, even though the functionality works within the app.
We also explored the possibility of hiding the system-generated Undo/Redo menu items so we could provide custom implementations—but couldn’t find a way to remove or override them.
Question:
Is there a recommended approach to enable or customize the Undo/Redo menu bar items on iPadOS using SwiftUI?
Any suggestions or insights would be greatly appreciated!
Feedback ID: FB18792279
I'm currently developing a new app and uses Menu in it. The Menu cannot display text color normally and after if collapses my second text also disappears for a short time. FB19221675
Does anyone has this same issue in iOS 26?
Topic:
UI Frameworks
SubTopic:
SwiftUI