We noticed in multiple apps that readableContentGuide is way too wide on iOS 26.x.
Here are changes between iPad 13inch iOS 18.3 and the same device iOS 26.2 (but this affects also iOS 26.0 and iOS 26.1):
13 inch iOS 18
Landscape ContentSizeCategory:
XS, Width: 1376.0 , Readable Width: 560.0
S, Width: 1376.0 , Readable Width: 600.0
M, Width: 1376.0 , Readable Width: 632.0
L, Width: 1376.0 , Readable Width: 664.0
XL, Width: 1376.0 , Readable Width: 744.0
XXL, Width: 1376.0 , Readable Width: 816.0
XXXL,Width: 1376.0 , Readable Width: 896.0
A_M, Width: 1376.0 , Readable Width: 1096.0
A_L, Width: 1376.0 , Readable Width: 1280.0
A_XL,Width: 1376.0 , Readable Width: 1336.0
13 inch iOS 26
Landscape ContentSizeCategory:
XS, Width: 1376.0 , Readable Width: 752.0
S, Width: 1376.0 , Readable Width: 800.0
M, Width: 1376.0 , Readable Width: 848.0
L, Width: 1376.0 , Readable Width: 896.0
XL, Width: 1376.0 , Readable Width: 1000.0
XXL, Width: 1376.0 , Readable Width: 1096.0
XXXL,Width: 1376.0 , Readable Width: 1200.0
A_M, Width: 1376.0 , Readable Width: 1336.0
The code I used:
class ViewController: UIViewController {
lazy var readableView: UIView = {
let view = UIView()
view.backgroundColor = .systemBlue
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(readableView)
NSLayoutConstraint.activate([
readableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
readableView.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor),
readableView.trailingAnchor.constraint(equalTo: view.readableContentGuide.trailingAnchor),
readableView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
])
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if readableView.frame.width > 0 {
let orientation = UIDevice.current.orientation
print("""
ContentSizeCategory: \(preferredContentSizeCategoryAsString())
Width: \(view.frame.width) , Readable Width: \(readableView.frame.width), Ratio: \(String(format: "%.1f", (readableView.frame.width / view.frame.width) * 100))%
""")
}
}
func preferredContentSizeCategoryAsString() -> String {
switch UIApplication.shared.preferredContentSizeCategory {
case UIContentSizeCategory.accessibilityExtraExtraExtraLarge:
return "A_XXXL"
case UIContentSizeCategory.accessibilityExtraExtraLarge:
return "A_XXL"
case UIContentSizeCategory.accessibilityExtraLarge:
return "A_XL"
case UIContentSizeCategory.accessibilityLarge:
return "A_L"
case UIContentSizeCategory.accessibilityMedium:
return "A_M"
case UIContentSizeCategory.extraExtraExtraLarge:
return "XXXL"
case UIContentSizeCategory.extraExtraLarge:
return "XXL"
case UIContentSizeCategory.extraLarge:
return "XL"
case UIContentSizeCategory.large:
return "L"
case UIContentSizeCategory.medium:
return "M"
case UIContentSizeCategory.small:
return "S"
case UIContentSizeCategory.extraSmall:
return "XS"
case UIContentSizeCategory.unspecified:
return "U"
default:
return "D"
}
}
}
Please advise, it feels completely broken.
Thank you.
Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I created an application extension that uses IdentityLookup framework for SMS filtering. How can I deploy my product as a library? I tried wrapping it as a framework, but it was not successful.
I'm building an app with a min iOS of 26.
In iOS 26, bottom toolbars are attached to the NavStack where in ios18 they were attached to a vstack or scrollview. But in ios26 if the toolbar is attached to something like a vstack, it displays too low on an iPhone 16e and sits behind the tab bar. Fine.
But with a parent-child view, the parent has a NavStack (with bottom toolbar attached) and the child view doesn't have a NavStack. So...that's a problem.
The functional impact of this contradiction (bottom toolbars go on the NavStack and child views don't have a NavStack) is actually two problems.
the parent view bottom toolbar shows up on the child view (because it's the closest NavStack) whether it's appropriate on the view or not.
the child view can't have a viable bottom toolbar because without a NavStack any buttons are hidden behind the tab view.
The second problem can be worked around using a top toolbar or safe area edge inset instead of a toolbar at the bottom or something.
But those don't solve the first problem of the parent view bleeding through.
So, I have to be crazy, right. Apple wouldn't create a scenario where bottom toolbars are not functional on parent-child views in ios26.
Any suggestions that I'm missing?
Topic:
UI Frameworks
SubTopic:
SwiftUI
When the guy was talking about structural identity, starting at about 8:53, he mentioned how the swiftui needs to guarantee that the two views can't swap places, and it does this by looking at the views type structure. It guarantees that the true view will always be an A, and the false view will always be a B.
Not sure exactly what he means because views can't "swap places" like dogs. Why isn't just knowing that some View is shown in true, and another is shown in false, enough for its identity? e.g. The identity could be "The view on true" vs
"The view on false", same as his example with "The dog on the left" vs "The dog on the right"
When I have a TextField or TextEditor, tapping into it produces these two console entries about 18 times each:
CHHapticPattern.mm:487 +[CHHapticPattern patternForKey:error:]: Failed to read pattern library data: Error Domain=NSCocoaErrorDomain Code=260 "The file “hapticpatternlibrary.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSURL=file:///Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSUnderlyingError=0x600000ca1b30 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
<_UIKBFeedbackGenerator: 0x600003505290>: Error creating CHHapticPattern: Error Domain=NSCocoaErrorDomain Code=260 "The file “hapticpatternlibrary.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSURL=file:///Library/Audio/Tunings/Generic/Haptics/Library/hapticpatternlibrary.plist, NSUnderlyingError=0x600000ca1b30 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
My app does not use haptics.
This doesn't appear to cause any issues, although entering text can feel a bit sluggish (even on device), but I am unable to determine relatedness. None-the-less, it definitely is a lot of log noise.
Code to reproduce in simulator (xcode 26.2; ios 26 or 18, with iPhone 16 Pro or iPhone 17 Pro):
import SwiftUI
struct ContentView: View {
@State private var textEntered: String = ""
@State private var textEntered2: String = ""
@State private var textEntered3: String = ""
var body: some View {
VStack {
Spacer()
TextField("Tap Here", text: $textEntered)
TextField("Tap Here Too", text: $textEntered2)
TextEditor(text: $textEntered3)
.overlay(RoundedRectangle(cornerRadius: 8).strokeBorder(.primary, lineWidth: 1))
.frame(height: 100)
Spacer()
}
}
}
#Preview {
ContentView()
}
Tapping back and forth in these fields generates the errors each time.
Thanks,
Steve
I've integrated PencilKit into my app, but I've noticed that shape recognition isn't working during drawing, even though it works perfectly in the Notes app. Is this a bug, or is shape recognition simply not supported in PencilKit for Swift?
Hello,
I'm trying to make a white-Label sort of thing for my app, that is: a script runs before the app launches, sets a certain LaunchAgent command that sets and environment variable, and based on that variable's value tha main app's icon changes to a certain logo (change only happens in the dock because changing the icon on disk breaks the signature)
When the app launches it takes a noticeable time until the dock icon changes to what I want, so I worked around that by setting the app's plist property to hide the dock icon and then when the app is launched I call an objc++ function to display the icon in the dock again (this time it displays as the new icon)
The showing happens through [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
The problem happens when I try to close the app, it returns back to the old logo before closing which is what I want to prevent. I tried hiding the app dock icon before closing but even the hiding itself changes the icon before hiding
The hiding happens through [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
My goal is that the main app icon doesn't appear to the user through the dock, and that the icon that is only visible is the other one that changes during runtime
The reason for this is that I have an app that should be visible differently depending on an environment variable that I set using an installer app. The app is the same for all users with very minor UI adjustments depending on that env variable's value. So instead of creating different versions of the app I'd like to have just 1 version that adjusts differently depending on the env variable's value. Somehow this is the only step left to have a smooth experience
Feel free to ask more clarification questions I'd be happy to help
Thank you
When I navigate to a player controller and switch to landscape mode, and then pop it and choose portrait mode, the tabBar encounters an issue
Topic:
UI Frameworks
SubTopic:
UIKit
I have a text editor where I replace the selected text when a button is tapped. Most of the time it works, but sometimes the new text is inserted at the end of the text instead of at the selected position. Is this a bug?
@Bindable var note: Richnote
@State private var selection = AttributedTextSelection()
var body: some View {
VStack {
TextEditor(text: $note.content, selection: $selection)
Button("Replace text") {
let textToInsert = "A long text that makes me think lalala"
note.content.replaceSelection(&selection, withCharacters: textToInsert)
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
I just found a weird bug:
If you place a Text view using .foregroundStyle(.secondary), .tertiary, or other semantic colors inside a ScrollView, and apply a Material background clipped to an UnevenRoundedRectangle, the text becomes invisible. This issue does not occur when:
The text uses .primary or explicit colors (e.g., .red, Color.blue), or
The background is clipped to a standard shape (e.g., RoundedRectangle).
A minimal reproducible example is shown below:
ScrollView{
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello World.")
.font(.system(size: 15))
.foregroundStyle(.quinary)
}
}
.padding()
.frame(height: 100)
.background(Material.regular)
.clipShape(UnevenRoundedRectangle(topLeadingRadius: 10,bottomLeadingRadius: 8,bottomTrailingRadius:8, topTrailingRadius: 8))
I have (had) a view controller that does a bit of manual layout in a -viewDidLayout override.
This was pretty easy to manage - however since introducing NSGlassEffectView into the view hierarchy I sometimes am getting hit with "Unable to simultaneously satisfy constraints" and Appkit would break a constraint to 'recover.' It appears translatesAutoresizingMaskIntoConstraints is creating some really weird fixed width and height constraints. Here I wasn't doing any autolayout - just add the glass view and set its frame in -viewDidLayout.
At runtime since I do manual layout in -viewDidLayout the frames are fixed and there is no real "error" in my app in practice though I wanted to get rid of the constraint breaking warning being logged because I know Autolayout can be aggressive about 'correctness' who knows if they decide to throw and not catch in the future.
In my perfect world I would probably just prefer a view.doesManualLayout = YES here - the subviews are big containers no labels so localization is not an issue for me. Rather than playing with autoresizing masks to get better translated constraints I decided to set translatesAutoresizingMaskIntoConstraints to NO and make the constraints myself. Now I get hit with the following exception:
"The window has been marked as needing another Layout Window pass, but it has already had more Layout Window passes than there are views in the window"
So this happens because the view which now has constraints -- I adjusted the frame of it one point in -viewDidLayout. My question is - is not legal to make changes in -viewDidLayout - which seems like the AppKit version of -viewDidLayoutSubviews.
In UIKit I always thought it was fine to make changes in -viewDidLayoutSubviews to frames - even if constraints were used - this is a place where you could override things in complex layouts that cannot be easily described in constraints. But in AppKit if you touch certain frames in -viewDidLayout it can now cause this exception (also related: https://developer.apple.com/forums/thread/806471)
I will change the constant of one of the constraints to account for the 1 point adjustment but my question still stands - is it not legal to touch frames in -viewDidLayout when autolayout constraints are used on that subview? It is (or at least was if I remember correctly) permitted to change the layout in -viewDidLayoutSubviews in UIKit but AppKit seems to be more aggressive in its checking for layout correctness).
What about calling -sizeToFit on a control in viewDidLayout or some method that has side effect of invalidating layout in a non obvious way, is doing things like this now 'dangerous?'
Shouldn't AppKit just block the layout from being invalidated from within -viewDidLayout - and leave whatever the layout is as is when viewDidLayout returns (thus making -viewDidLayout a useful place to override layout in the rare cases where you need a sledgehammer?)
Description:
I’m encountering an issue where the Apple Watch’s watchOS version is lower than the deployment target specified in my Xcode project.
For example, my Watch device is running watchOS 10.6, but my app’s deployment target is set to watchOS 9.6 or 10.6, and Xcode shows an error stating:
Error: “watchOS version doesn’t match the app’s deployment target.”
Could someone clarify how to properly handle this version mismatch?
Environment:
Xcode 26
iPhone: iOS 18
Apple Watch: watchOS 10.6
Any guidance or best practices would be appreciated.
Switching alternative app icons previously worked in my app and I did not notice when it broke.
However now the completion handler consistently returns this error if feeding with either an existing app icon name or a fictional one.
Is this a regression I should file a bug report for or am I doing something wrong here?
Include all app icon assets is enabled in the target
Below you can see the error, the .icon files placed in the project navigator, my code and the top of the Info.plist
Thank you
Button("Update icon") { UIApplication.shared.setAlternateIconName("appIcon_Heart") { error in
if let error {
print(error)
}
}
}
Error Domain=NSPOSIXErrorDomain Code=35 "Resource temporarily unavailable" UserInfo={_LSFile=LSIconAlertManager.m, _LSLine=113, _LSFunction=-[LSIconAlertManager iconChangeAlertTokenForIdentity:error:]}
Xcode seems to create the correct Info.plist entries.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>newReleasesBackgroundTask</string>
</array>
<key>BuildMachineOSBuild</key>
<string>24G90</string>
<key>CFBundleDevelopmentRegion</key>
<string>de</string>
<key>CFBundleDisplayName</key>
<string>Hörspielzentrale</string>
<key>CFBundleExecutable</key>
<string>Hoerspielzentrale</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>appIcon_Heart</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_Heart</string>
</dict>
<key>appIcon_RedNoCircle</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_RedNoCircle</string>
</dict>
<key>appIcon_WhiteNoCircle</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_WhiteNoCircle</string>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>appIcon_Heart</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_Heart</string>
</dict>
<key>appIcon_RedNoCircle</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_RedNoCircle</string>
</dict>
<key>appIcon_WhiteNoCircle</key>
<dict>
<key>CFBundleIconName</key>
<string>appIcon_WhiteNoCircle</string>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
<string>AppIcon76x76</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
Topic:
UI Frameworks
SubTopic:
UIKit
My app (FindAnyFile) provides a Finder-like interface in which it also offers a QuickLook preview command, which invokes
[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil];
Now, if it shows .abcdp files, it often, but not always, crashes.
This has been happening for many macOS versions, at least since 10.15, up to 26.1. Also, it does not seem to matter which SDK/Xcode I build with, as I used several and all versions lead to the crash. The issue rather appears to be inside the QLplugin for the AB file (ABCardCollectionView etc.).
I am able to trace this crash in Xcode. There are a LOT of errors and warnings coming up, and eventually the qlplugin throws an ObjC exception which in turn brings down my entire app (and here I thought that the XPC system was designed to expressly avoid such crashes).
Possibly significant errors are:
CNAccountCollectionUpdateWatcher 0x6000025cf800: Update event received, but store registration failed. This event will be handled, but the behavior is undefined.
Error using remote object proxy when fetchAnonymousXPCEndpoint: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.telephonyutilities.callservicesdaemon.callstatecontroller" UserInfo={NSDebugDescription=connection to service named com.apple.telephonyutilities.callservicesdaemon.callstatecontroller}
connection to service named com.apple.coreduetd.people … CNPropertyNotFetchedException: A property was not requested when contact was fetched.
I've attached the (mostly) complete console output from such a debug run.
I have also an open bug report regarding this kind of crash (back then I was not able to reproduce it myself): FB15553847
Also, when I "Quick Look" the same file in Finder, I get a "Preview not permitted" for the same items that crash in my app. If I copy the same items to the Desktop, then Finder can QL them and my app doesn't crash when viewing the item on the Desktop. So, the crash only happens with the items inside ~/Library/Application Support/AddressBook/Sources/…/Metadata/.
Now, here is the weirdest part: You might think: So, if the Finder shows "Preview not permitted", then my app trying to view those items is the result of that condition (even if that's not supposed to crash). However: I have a clean 26.1 install (in an Apple ARM VM) where Finder also says "Preview not permitted" for these items in the user's Library/AB/Metadata folder, but my app can QL those items without crashing! Also, I have one user who uses 26.1 and gets the crash with files in the same location. So, the "Preview not permitted" is probably not the cause of this crash, though it's suspicious that a user gets this at all - why can't a user QL the abcdp files in the Metadata folder but when copied to the Desktop, QL works? You'd think that Finder has the necessary entitlements to access the AB, or doesn't it?
Of course, my app has permission enabled under Privacy & Security / Contacts (if it's disabled, then the app can't show anything but will also not crash). And it has the "Address Book" entitlement.
Would be nice if this could be looked into and eventually be fixed.
Alternatively, I'd welcome any suggestions on how to prevent my app from crashing if the qlplugin throws. But if you look at the stack trace you'll see that there's no method of my own app involved where I could insert an exception catcher.
I added code to my previewItemURL delegate method to make sure the NSURL item is readable, and it is, even
Of course, apart from the issue with .abcdp files, the QL operation in my app works flawlessly, i.e. I have never received any other crash reports relating to any other QL plugins.
QuickLook for AddressBook crash messages
Hi,
I am looking to display (in SwiftUI) the Tabview page dots like in the weather app in the toolbar, an important thing is I want to keep page controls by tapping and scrubbing.
Actually, I want to do what's on Apple Design's Page Controls page; here's the link and a photo of what I'd like to do.
Could you help me?
https://developer.apple.com/design/human-interface-guidelines/page-controls
I have an existing iOS app with MapKit. It always shows the current user location with UserAnnotation. But the same isn't true for macOS. I have this sample macOS application in SwiftUI. In the following, the current user location with a large blue dot appears only occasionally. It won't, 19 of 20 times. Why is that? I do have a location privacy key in Info.plist. And the Location checkbox is on under Signing & Capabilities.
import SwiftUI
import MapKit
struct ContentView: View {
@State private var markerItems: [MarkerItem] = [
MarkerItem(name: "Farmers Market 1", lat: 35.681, lon: 139.691),
MarkerItem(name: "Farmers Market 2", lat: 35.685, lon: 139.695),
MarkerItem(name: "Farmers Market 3", lat: 35.689, lon: 139.699)
]
@State private var position: MapCameraPosition = .automatic
var body: some View {
Map(position: $position) {
UserAnnotation()
ForEach(markerItems, id: \.self) { item in
Marker(item.name, coordinate: CLLocationCoordinate2D(latitude: item.lat, longitude: item.lon))
}
}
.mapControlVisibility(.hidden)
.mapStyle(.standard(elevation: .realistic))
.ignoresSafeArea()
}
}
#Preview {
ContentView()
}
struct MarkerItem: Hashable {
let name: String
let lat: Double
let lon: Double
}
Is anyone else getting new warning about menu items with submenus when running on Tahoe? I'm getting big performance problems using my menu as well as seeing these messages and I'm wondering if there's a connection.
My app is faceless with a NSStatusItem with an NSMenu. Specifically it's my own subclass of NSMenu where I have a lot of code to manage the menu's dynamic behavior. This code is directly in the menu subclass instead of in a controller because the app I forked had it this way, a little wacky but I don't see it being a problem. A nib defines the contents of the menu, and it's instantiated manually with code like:
var nibObjects: NSArray? = []
guard let nib = NSNib(nibNamed: "AppMenu", bundle: nil) else { ... }
guard nib.instantiate(withOwner: owner, topLevelObjects: &nibObjects) else { ... }
guard let menu = nibObjects?.compactMap({ $0 as? Self }).first else { ... }
Within that nib.instantiate call I see a warning logged that seems new to Tahoe, before the menu's awakeFromNib is called, that says (edited):
Internal inconsistency in menus - menu <NSMenu: 0x6000034e5340> believes it has <My_StatusItem_App.AppMenu: 0x7f9570c1a440> as a supermenu, but the supermenu does not seem to have any item with that submenu
My_StatusItem_App.AppMenu: 0x7f9570c1a440 is my menu belonging to the NSStatusItem, NSMenu: 0x6000034e5340 is the submenu of one of its menu items.
At a breakpoint in the NSMenu subclass's awakeFromNib I print self and see clear evidence of the warning's incorrectness. Below is a snippet of the console including the full warning, only edited for clarity and brevity. It shows on line 32 menu item with placeholder title "prototype batch item" that indeed has that submenu.
Internal inconsistency in menus - menu <NSMenu: 0x6000034e5340>
Title:
Supermenu: 0x7f9570c1a440 (My StatusItem App), autoenable: YES
Previous menu: 0x0 (None)
Next menu: 0x0 (None)
Items: (
"<NSMenuItem: 0x6000010e4fa0 Do The Thing Again, ke mask='<none>'>",
"<NSMenuItem: 0x6000010e5040 Customize\U2026, ke mask='<none>'>",
"<NSMenuItem: 0x6000010e50e0, ke mask='<none>'>"
) believes it has <My_StatusItem_App.AppMenu: 0x7f9570c1a440>
Title: My StatusItem App
Supermenu: 0x0 (None), autoenable: YES
Previous menu: 0x0 (None)
Next menu: 0x0 (None)
Items: (
) as a supermenu, but the supermenu does not seem to have any item with that submenu
(lldb) po self
<My_StatusItem_App.AppMenu: 0x7f9570c1a440>
Title: My StatusItem App
Supermenu: 0x0 (None), autoenable: YES
Previous menu: 0x0 (None)
Next menu: 0x0 (None)
Items: (
"<NSMenuItem: 0x6000010fd7c0 About My StatusItem App\U2026, ke mask='<none>', action: showAbout:, action image: info.circle>",
"<NSMenuItem: 0x6000010fd860 Show Onboarding Window\U2026, ke mask='Shift', action: showIntro:>",
"<NSMenuItem: 0x6000010fd900 Update Available\U2026, ke mask='<none>', action: installUpdate:, standard image: icloud.and.arrow.down, hidden>",
"<NSMenuItem: 0x6000010e46e0, ke mask='<none>'>",
"<NSMenuItem: 0x6000010e4780 Start The Thing, ke mask='<none>', action: startTheThing:>",
"<NSMenuItem: 0x6000010e4dc0 \U2318-\U232b key detector item, ke mask='<none>', view: <My_StatusItem_App.KeyDetectorView: 0x7f9570c1a010>>",
"<NSMenuItem: 0x6000010e4e60, ke mask='<none>'>",
"<NSMenuItem: 0x6000010e4f00 saved batches heading item, ke mask='<none>', view: <NSView: 0x7f9570b4be10>, hidden>",
"<My_StatusItem_App.BatchMenuItem: 0x6000016e02c0 prototype batch item, ke mask='<none>', action: replaySavedBatch:, submenu: 0x6000034e5340 ()>",
"<NSMenuItem: 0x6000010f7d40, ke mask='<none>'>",
"<My_StatusItem_App.ClipMenuItem: 0x7f956ef14fd0 prototype copy clip item, ke mask='<none>', action: copyClip:>",
"<NSMenuItem: 0x6000010fa620 Settings\U2026, ke='Command-,', action: showSettings:>",
"<NSMenuItem: 0x6000010fa6c0, ke mask='<none>'>",
"<NSMenuItem: 0x6000010fa760 Quit My StatusItem App, ke='Command-Q', action: quit:>"
)
Is this seemingly incorrect inconsistency message harmless? Am I only grasping at straws to think it has some connection to the performance issues with this menu?
The zoom navigation transition with matchedTransitionSource in tabViewBottomAccessory does not work when a Published var in an ObservableObjector Observable gets changed.
Here is an minimal reproducible example with ObservableObject:
import SwiftUI
import Combine
private final class ViewModel: ObservableObject {
@Published var isPresented = false
}
struct ContentView: View {
@Namespace private var namespace
@StateObject private var viewModel = ViewModel()
// @State private var isPresented = false
var body: some View {
TabView {
Button {
viewModel.isPresented = true
} label: {
Text("Start")
}
.tabItem {
Image(systemName: "house")
Text("Home")
}
Text("Search")
.tabItem {
Image(systemName: "magnifyingglass")
Text("Search")
}
Text("Profile")
.tabItem {
Image(systemName: "person")
Text("Profile")
}
}
.sheet(isPresented: $viewModel.isPresented) {
Text("Sheet")
.presentationDragIndicator(.visible)
.navigationTransition(.zoom(sourceID: "tabViewBottomAccessoryTransition", in: namespace))
}
.tabViewBottomAccessory {
Button {
viewModel.isPresented = true
} label: {
Text("BottomAccessory")
}
.matchedTransitionSource(id: "tabViewBottomAccessoryTransition", in: namespace)
}
}
}
However, when using only a State property everything works:
import SwiftUI
import Combine
private final class ViewModel: ObservableObject {
@Published var isPresented = false
}
struct ContentView: View {
@Namespace private var namespace
// @StateObject private var viewModel = ViewModel()
@State private var isPresented = false
var body: some View {
TabView {
Button {
isPresented = true
} label: {
Text("Start")
}
.tabItem {
Image(systemName: "house")
Text("Home")
}
Text("Search")
.tabItem {
Image(systemName: "magnifyingglass")
Text("Search")
}
Text("Profile")
.tabItem {
Image(systemName: "person")
Text("Profile")
}
}
.sheet(isPresented: $isPresented) {
Text("Sheet")
.presentationDragIndicator(.visible)
.navigationTransition(.zoom(sourceID: "tabViewBottomAccessoryTransition", in: namespace))
}
.tabViewBottomAccessory {
Button {
isPresented = true
} label: {
Text("BottomAccessory")
}
.matchedTransitionSource(id: "tabViewBottomAccessoryTransition", in: namespace)
}
}
}
I'm attempting to use WebAuthenticationSession from Authentication Services (https://developer.apple.com/documentation/authenticationservices/webauthenticationsession) in a SwiftUI app on macOS.
According to the docs, it is supported since macOS 13.3 and I'm testing on 26.
I'm deploying the same code to iOS as well, and it works there in a simulator, but I sometimes have to tap the button that triggers the authenticate(…) call more than once.
I've attached a simplified and redacted version of the code below. It works on iOS, but on macOS the authenticate call never returns.
There seems to be very little documentation and discussion about this API and I'm running out of ideas for getting this to work. Is this just a bug that Apple hasn't noticed?
import SwiftUI
import AuthenticationServices
import Combine
struct PreAuthView: View {
@Binding var appState: AppState
@Binding var credentials: Credentials?
@Environment(\.webAuthenticationSession) private var webAuthenticationSession
@State private var plist: String = ""
func authenticate() async {
guard var authUrl = URL(string: "REDACTED") else { return }
guard var tokenUrl = URL(string: "REDACTED") else { return }
let redirectUri = "REDACTED"
let clientId = "REDACTED"
let verifier = "REDACTED"
let challenge = "REDACTED"
authUrl.append(queryItems: [
.init(name: "response_type", value: "code"),
.init(name: "client_id", value: clientId),
.init(name: "redirect_uri", value: redirectUri),
.init(name: "state", value: ""),
.init(name: "code_challenge", value: challenge),
.init(name: "code_challenge_method", value: "S256"),
])
let scheme = "wonderswitcher"
do {
print("Authenticating")
let redirectUrl = try await webAuthenticationSession.authenticate(
using: authUrl,
callback: .https(host: "REDACTED", path: "REDACTED"),
additionalHeaderFields: [:],
)
print("Authenticated?")
print(redirectUrl)
let queryItems = URLComponents(string: redirectUrl.absoluteString)?.queryItems ?? []
let code = queryItems.filter({$0.name == "code"}).first?.value
let session = URLSession(configuration: .ephemeral)
tokenUrl.append(queryItems: [
.init(name: "grant_type", value: "authorization_code"),
.init(name: "code", value: code),
.init(name: "redirect_uri", value: redirectUri),
.init(name: "code_verifier", value: verifier),
.init(name: "client_id", value: clientId),
])
var request = URLRequest(url: tokenUrl)
request.httpMethod = "POST"
let response = try await session.data(for: request)
print(response)
} catch {
return
}
}
var body: some View {
NavigationStack {
VStack(alignment: .leading, spacing: 12) {
Text("This is the pre-auth view.")
HStack {
Button("Log in") {
Task {
await authenticate()
}
}
Spacer()
}
Spacer(minLength: 0)
}
.padding()
.navigationTitle("Pre-Auth")
}
}
}
#Preview {
PreAuthView(appState: .constant(.preAuth), credentials: .constant(nil))
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
I’m running Xcode 26.1.1 (17B100) with deployment target iOS 18.0+, and I’m seeing a consistent and reproducible issue on real devices (iPhone 13 Pro, iPhone 15 Pro):
Problem
The first time the user taps into a TextField or a SwiftUI .searchable field after app launch, the app freezes for 30–45 seconds before the keyboard appears.
During the freeze, the device console floods with:
XPC connection interrupted
Reporter disconnected. { function=sendMessage, reporterID=XXXXXXXXXXXX }
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:]
perform input operation requires a valid sessionID.
inputModality = Keyboard
customInfoType = UIEmojiSearchOperations
After the keyboard finally appears once, the issue never happens again until the app is force-quit.
This occurs on device
Reproduction Steps
Minimal reproducible setup:
Create a new SwiftUI app.
Add a single TextField or .searchable modifier.
Install Firebase (Firestore or Analytics is enough).
Build and run on device.
Tap the text field immediately after the home screen appears.
Result:
App freezes for 30–45 seconds before keyboard appears, with continuous XPC/RTIInputSystem errors in the logs.
If Firebase is removed, the issue occurs less often, but still happens occasionally.
Even If Firebase initialization is delayed by ~0.5 seconds, the issue is still there.
Question
Is this a known issue with iOS 18 / RTIInputSystem / Xcode 26.1.1, and is there a recommended workaround?
Delaying Firebase initialization avoids the freeze, but this isn’t ideal for production apps with startup authentication requirements.
Any guidance or confirmation would be appreciated.
Topic:
UI Frameworks
SubTopic:
SwiftUI