Post

Replies

Boosts

Views

Activity

Reply to How to get the frame or insets of the new iPadOS 26 window control buttons (close, minimize, fullscreen)?
I have the same question. WWDC Sessions and the HIG mention "moving your controls" when the window control appears. It's great that this happens automatically when using a standard NavigationStack and standard toolbar, however for apps that are unable to use standard UI elements, the documentation currently makes it sound like there is some way to get this sizing programmatically. Filed FB18559686 Screenshot of the issue: Sample code to make this happen: import SwiftUI struct ContentView: View { var body: some View { VStack(spacing: 0) { HStack { // Trying to make this button respect window controls safe area Button(action: { }, label: { Image(systemName: "xmark") }) .padding() .foregroundStyle(.primary) .glassEffect() Spacer() } .padding() .background(.fill.quaternary) Rectangle() .foregroundStyle(.fill.quinary) } } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’25
Reply to How to get the frame or insets of the new iPadOS 26 window control buttons (close, minimize, fullscreen)?
@Mobiel I was able to use your example to create a UIKit → SwiftUI connection where those layout guide values are available to a SwiftUI view. It works okay. You can see here the red box is in SwiftUI, and it is detecting where the window control is. There is one issue, which is that when the window is returned to full screen, the layout guide is not updating to "0" size for the window control. Not sure if that's an iPadOS beta bug or what. Here is a screenshot: Here is the code: // // ContentView.swift // WindowControlsTest // // Created by MAK on 8/7/25. // import SwiftUI import UIKit struct ContentView: View { @State var offsets = WindowControlDetection() var body: some View { ZStack(alignment: .topLeading) { WindowControlsUIKitViewRepresentable() Rectangle() .foregroundStyle(.red) .frame(width: offsets.leadingInset, height: offsets.topInset) Rectangle() .hidden() .overlay { Text("leading: \(Int(offsets.leadingInset)) top: \(Int(offsets.topInset))") } } .ignoresSafeArea() .environment(offsets) } } @Observable class WindowControlDetection { var leadingInset: CGFloat = 0 var topInset: CGFloat = 0 } class WindowControlsUIKitView: UIView { private let offsets: WindowControlDetection init(offsets: WindowControlDetection) { self.offsets = offsets super.init(frame: .zero) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() let newLeading = layoutGuide(for: .margins(cornerAdaptation: .horizontal)).layoutFrame.minX let newTop = layoutGuide(for: .margins(cornerAdaptation: .vertical)).layoutFrame.minY DispatchQueue.main.async { [weak offsets] in offsets?.leadingInset = newLeading offsets?.topInset = newTop } } } struct WindowControlsUIKitViewRepresentable: UIViewRepresentable { @Environment(WindowControlDetection.self) var layoutOffsets func makeUIView(context: Context) -> WindowControlsUIKitView { return WindowControlsUIKitView(offsets: layoutOffsets) } func updateUIView(_ uiView: WindowControlsUIKitView, context: Context) { } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to ScrollViewReader's scrollTo may be broken on iOS 15
From my testing, this appears to be fixed in iOS 15.4 developer beta. My radar reproduction works perfectly on the beta and was broken on 15.3 and earlier
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to "The bundle version, NNN, must be a higher than the previously uploaded version"
I am still seeing this error today, on build numbers and uploads that were working fine before. Does anybody know if the fix was implemented already?
Replies
Boosts
Views
Activity
Apr ’22
Reply to Does Generable support recursive schemas?
Filed Feedback FB17962270
Replies
Boosts
Views
Activity
Jun ’25
Reply to How to get the frame or insets of the new iPadOS 26 window control buttons (close, minimize, fullscreen)?
I have the same question. WWDC Sessions and the HIG mention "moving your controls" when the window control appears. It's great that this happens automatically when using a standard NavigationStack and standard toolbar, however for apps that are unable to use standard UI elements, the documentation currently makes it sound like there is some way to get this sizing programmatically. Filed FB18559686 Screenshot of the issue: Sample code to make this happen: import SwiftUI struct ContentView: View { var body: some View { VStack(spacing: 0) { HStack { // Trying to make this button respect window controls safe area Button(action: { }, label: { Image(systemName: "xmark") }) .padding() .foregroundStyle(.primary) .glassEffect() Spacer() } .padding() .background(.fill.quaternary) Rectangle() .foregroundStyle(.fill.quinary) } } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to How can I avoid overlapping the new iPadOS 26 window controls without using .toolbar?
I filed FB18559686 for this, and was just discussing the same issue over in https://developer.apple.com/forums/thread/790994
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to How do I stop iPadOS from thinking a drag is for a new window?
Filed FB18423759 : Dragging causes new window to open unintentionally
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Clear Liquid Glass Modifier
Apparently, Xcode 26b3 added in support for Glass.clear! https://mjtsai.com/blog/2025/07/09/xcode-26-beta-3/
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’25
Reply to How to get the frame or insets of the new iPadOS 26 window control buttons (close, minimize, fullscreen)?
That is interesting and promising that there is something for it in UIKit. Hopefully we get something for it in SwiftUI.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to avoid the traffic light buttons on iPad
I filed FB18559686 for this, and was just discussing the same issue over in https://developer.apple.com/forums/thread/790994
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to get the frame or insets of the new iPadOS 26 window control buttons (close, minimize, fullscreen)?
@Mobiel I was able to use your example to create a UIKit → SwiftUI connection where those layout guide values are available to a SwiftUI view. It works okay. You can see here the red box is in SwiftUI, and it is detecting where the window control is. There is one issue, which is that when the window is returned to full screen, the layout guide is not updating to "0" size for the window control. Not sure if that's an iPadOS beta bug or what. Here is a screenshot: Here is the code: // // ContentView.swift // WindowControlsTest // // Created by MAK on 8/7/25. // import SwiftUI import UIKit struct ContentView: View { @State var offsets = WindowControlDetection() var body: some View { ZStack(alignment: .topLeading) { WindowControlsUIKitViewRepresentable() Rectangle() .foregroundStyle(.red) .frame(width: offsets.leadingInset, height: offsets.topInset) Rectangle() .hidden() .overlay { Text("leading: \(Int(offsets.leadingInset)) top: \(Int(offsets.topInset))") } } .ignoresSafeArea() .environment(offsets) } } @Observable class WindowControlDetection { var leadingInset: CGFloat = 0 var topInset: CGFloat = 0 } class WindowControlsUIKitView: UIView { private let offsets: WindowControlDetection init(offsets: WindowControlDetection) { self.offsets = offsets super.init(frame: .zero) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() let newLeading = layoutGuide(for: .margins(cornerAdaptation: .horizontal)).layoutFrame.minX let newTop = layoutGuide(for: .margins(cornerAdaptation: .vertical)).layoutFrame.minY DispatchQueue.main.async { [weak offsets] in offsets?.leadingInset = newLeading offsets?.topInset = newTop } } } struct WindowControlsUIKitViewRepresentable: UIViewRepresentable { @Environment(WindowControlDetection.self) var layoutOffsets func makeUIView(context: Context) -> WindowControlsUIKitView { return WindowControlsUIKitView(offsets: layoutOffsets) } func updateUIView(_ uiView: WindowControlsUIKitView, context: Context) { } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to avoid the traffic light buttons on iPad
I posted a sort-of solution in https://developer.apple.com/forums/thread/790994 that shows a mostly working way to detect the frame of the window controls
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to avoid the traffic light buttons on iPad
incredible find @StephenJohnson! Thank you!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Sep ’25
Reply to How to avoid the traffic light buttons on iPad
Just wanted to add that this can also be accessed via the onGeometryChange modifier if you'd prefer not to have a wrapping GeometryReader. Example: .onGeometryChange(for: RectangleCornerInsets.self, of: { $0.containerCornerInsets }, action: { (_, new) in print("insets", new) })
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Sep ’25