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.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Is the MapKit Legal Notice required for displaying my own content?
If an application utilizes MapKit exclusively to render custom content via MKTileOverlay (with canReplaceMapContent = true to entirely suppress Apple’s default map layers), are developers still contractually or technically mandated to display Apple's default "Legal" link? Currently, the hardcoded Apple attribution document details extensive copyright disclaimers for data suppliers like TomTom, Acxiom, and Breezometer. When an application renders entirely standalone, proprietary, or open-source map tiles, displaying this link creates two distinct issues: User Confusion: It incorrectly implies to end-users that the custom data being viewed is sourced from or validated by Apple's third-party data partners. Attribution Inaccuracy: It forces the display of entirely irrelevant copyright data while doing a disservice to the actual copyright holders of the active custom tile layers, who require their own distinct, prominent on-screen credit. It would be a significant UX improvement if the framework could dynamically hide the global data attribution link when canReplaceMapContent is active, allowing developers to provide accurate, context-specific legal text for the data layers actually in use.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
122
2h
ViewBridge to RemoteViewService Terminated (...)
After updating to Sonoma, the following is logged in the Xcode console when an editable text field becomes key. This doesn't occur on any text field, but it seems to happen when the text field is within an NSPopover or an NSSavePanel. ViewBridge to RemoteViewService Terminated: Error Domain=com.apple.ViewBridge Code=18 "(null)" UserInfo={com.apple.ViewBridge.error.hint=this process disconnected remote view controller -- benign unless unexpected, com.apple.ViewBridge.error.description=NSViewBridgeErrorCanceled} What does this mean?
Topic: UI Frameworks SubTopic: AppKit
11
9
3.8k
8h
UIRequiresFullScreen Deprecation
I work on a universal app that targets both iPhone and iPad. Our iPad app currently requires full screen. When testing on the latest iPadOS 26 beta, we see the following warning printed to the console: Update the Info.plist: 1) `UIRequiresFullScreen` will soon be ignored. 2) Support for all orientations will soon be required. It will take a fair amount of effort to update our app to properly support presentation in a resizable window. We wanted to gauge how urgent this change is. Our testing has shown that iPadOS 26 supports our app in a non-resizable window. Can someone from Apple provide any guidance as to how soon “soon” is? Will UIRequiresFullScreen be ignored in iPadOS 26? Will support for all orientations be required in iPadOS 26?
10
4
1.6k
8h
Programatically adding to a TextField and moving the TextSelection point in SwiftUI
Hi! I am trying to create a simple SwiftUI TextField, with an external button to add text to the field at the current insertion point (the cursor in the TextField). When I add the text, the cursor (I-Beam) remains at the original insertion point, so I want it to move over to the end of what I added. The trouble is, it sometimes moves further forward or to the end (visibly) but works as if it is still at the point I moved it to. This seems to possibly be due to emojis in the TextField (because, I assume, they are composed of more bytes). Further, sometimes the addition of the text can cause an emoji to appear unexpectedly, I assume because it is combining the bytes in an odd way. So moving the cursor seems to sometimes introduce weird behaviour. This comes from a much larger project, but I have distilled this down to the smallest example project I could. And I have a video to show how it behaves. Here's the main part of the code, and I'll attach an Xcode project: import SwiftUI struct ContentView: View { @State private var text: String = "abcdef🧁🧁🧁🧁ghijkl" @State private var selectedText: TextSelection? var body: some View { VStack { TextField("", text: $text, selection: $selectedText) .font(.title) Button("Add Z at Insertion Point in TextField") { // Get indices of any selection in the text field let from: String.Index, to: String.Index if let selectedText = selectedText { let indices = selectedText.indices switch indices { case .selection(let range): from = range.lowerBound to = range.upperBound case .multiSelection(let rangeSet): from = rangeSet.ranges.first!.lowerBound to = rangeSet.ranges.first!.upperBound default: from = self.text.endIndex to = self.text.endIndex } } else { from = self.text.endIndex to = self.text.endIndex } guard from <= to && from <= self.text.endIndex else { return } // Insert and update the cursor position self.text.replaceSubrange(from..<to, with: "Z") // Move cursor after the inserted character let newIndex = self.text.index(after: from) selectedText = TextSelection(insertionPoint: newIndex) } } .padding() } } STEPS TO REPRODUCE Run the app. Also view the video as it shows the steps. Put insertion point between c and d. Press the "Add Z" button. Note that Z is placed between c and d. This is great. Put insertion point between h and i. Press the "Add Z" button. Note that Z is placed between h and i. BUT, the insertion point I-beam moves to the end of the string. Press the "Add Z" button again. Z is added where you would have expected based on where the TextSelection insertion point was put, but the flashing I-Beam is still at the end. Press the "Add Z" button again. Same issue. insertion point is being shown at end, but to the button it is between Z and i. OF NOTE, if you use the keyboard and press delete, it deletes from end (where the I-beam is). Now put insertion point between the 4 cupcakes. Press "Add Z" two times. It behaves correctly. Press "Add Z" a third time. It adds a fairy emoji. So, any idea what I am doing wrong? I thought it might be an issue requiring me to update in a background thread, but I tried that, even delaying the update in the thread, but the issue remains. Thanks in advance. Here's a video: https://curmi.name/temp/SimpleTextField%20showing%20issues.mp4 And if it helps, here is the Xcode project: https://curmi.name/temp/SimpleTextfield.zip
2
0
361
18h
Switch view that digital crown controls
I wonder if there is way to switch the view that the digital crown controls. Like if have a list and a vertical tab view, when the tab displays, I want the crown control the scrolling in the tab. I dont want to use sheet, cause I have some special UX design, and also dont want to use if else to toggle between the two views. I have tried with resetFocus and other focus related functions, not working
1
0
143
22h
Count of Windows Open in App Switcher on iPadOS? Tried Via UIApplication.sharedApplication.openSessions
I'm trying to get the count of how many windows an iPadOS app has 'open' (open from the user's perspective in the app switcher). This is for the sake of determining whether I should show or hide a button that takes action on every window (if there is only 1 window, the button will be hidden). According to the documentation the proper API for this is this property on UIApplication: // All of the representations that currently have connected UIScene instances or had their sessions persisted by the system (ex: visible in iOS' switcher) @property(nonatomic, readonly) NSSet<UISceneSession *> *openSessions So I print the count (only sessions with role UIWindowSceneSessionRoleApplication) when scenes are added/removed etc via appropriate lifecycle notifications like -sceneDidDisconnect: -sceneDidBecomeActive: and so forth. What I noticed is when I add a new window scene, the count increases by one so cool, that works. But when I kill a window in the App switcher the count does not decrease. I can end up in a situation where the app has only 1 window in the app switcher but the count prints 8, so this is wrong. So am I using the wrong API? How can I just get scene count in the app switcher? The documentation makes it seem like using 'connectedScenes' for this would be wrong because that property is not supposed to include 'archived' scenes in the app switcher (or is it?)? I do know I can't take action on an archived scene 'yet' but I would still show the button because whether or not the scene is archived in the app switcher is a fact that remains hidden from the user. My code will take care of that later after state restoration. Is iPadOS 26 potentially keeping scene sessions open for too long? Is there a good way to reliably detect how many scenes I have in the app switcher? Is a scene session explicitly killed by the user supposed to remain the .openSessions set? I am testing on the Simulator FWIW. iPad 26.5.
0
0
36
23h
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
1
0
90
1d
NSTextAttachment view flicker while typing in same paragraph
I using SwiftUI to wrap a NSTextView to support rich text editing. I created a subclass ImageAttachment and provided my own viewProvider and attachmentView. The insertion of the image works fine, but when I typing in the same paragraph of the image, the image will flicker during typing and pause. after typing it sometimes just display nothing, but after refresh or click other places, the image shows. The interesting part is if I typing in other paragraph, the image attachment displays well. I don't think the flicker should happen while typing in the same paragraph of the attachment, but not sure if there is a way to enforce the layout stable for the paragraph?
Topic: UI Frameworks SubTopic: AppKit
1
0
165
1d
After binding to NSBrowser indexPaths the browser assumes I'm using NSBrowserCell and calls unimplemented methods on my NSCell subclass
So after binding to NSBrowser selectionIndexPaths: https://developer.apple.com/library/archive/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSBrowser.html this causes NSBrowser to do some weird stuff that seems completely unrelated to this particular binding. It starts calling NSBrowserCell methods on my cells but my cell is not a NSBrowserCell. My cell is actually a subclass of NSTextFieldCell. But NSBrowser starts sending setIsLeaf: (which I don't implement). In any case if I implement the -setLeaf: that solves that unrecognized selector, but now my cells don't draw titles. Not sure why binding to selectionIndexPaths causes this behavior? The cell stuff seems unrelated to this particular binding. I am of course using the newer but still pretty old item based APIs... do these bindings only support using NSMatrix? I do set the binding after calling -setCellClass: but makes no difference. I also just tried overriding -setSelectionIndexPaths: but NSBrowser does not use the setter.
1
0
117
1d
Crash in PDFView / PDFPageAnalyzerV2
Hello. Some users of my app experience crashes that mention PDFKit. I managed to find out what specific PDF file caused the crash and created a sample that demonstrates the issue and created a bug report in Feedback Assistant (FB22409977). Unfortunately I didn't get any answer for over a month, hence I'm writing it here so others can see that this is a known issue. The crash repro sample is very simple, it's just a PDFView that opens a bundled PDF file upon application lanunch. To cause the crash it is only needed to zoom-in and move around the page that has a table. The crash happens when the system tries to do some sort of OCR. The original crash report came from iPhone 11 user running iOS 26.3.1. Recently another user with iPhone 16 Pro Max running 26.5 experienced the same crash. Thread 12 Queue : PDFKWit.PDFDocument.formFillingQueue (serial) #0 0x000000018d320bd8 in PageLayout::GetBoundsForRangeWithinLine () #1 0x000000018d320c88 in PageLayout::GetBoundsForTextRange () #2 0x000000018d393028 in CGPDFTaggedNodeCreateCopyWithStringRange () #3 0x000000018d316630 in invocation function for block in TaggedParser::InsertLinkAnnotationsIntoStructureTree(CGPDFTaggedNode*, CGPDFPage*, PageLayout&) () #4 0x000000018d104f00 in CGPDFPageEnumerateAnnotations () #5 0x000000018d106968 in CGPDFPageCopyRootTaggedNode () #6 0x000000018d106710 in CGPDFPageInsertTableDescriptions () #7 0x00000001957a65b8 in +[PDFPageAnalyzerV2 addTablesFromVisionDocument:documentImage:toPage:withBox:] () #8 0x00000001957a3030 in +[PDFPageAnalyzerV2 analyzePage:withBox:requestTypes:] () #9 0x000000019584c018 in __31-[PDFView visiblePagesChanged:]_block_invoke () When CG_PDF_VERBOSE env variable is set, "New text range needs to be within the original node's text range." warning is printed to console several times before the crash happens.
1
0
123
1d
SwiftUI retain cycle with .searchable
I'm trying to see what I am doing wrong ... So I created this simple app where the stateobject Retainer won't get deallocated when I pop the view off the stack: import SwiftUI struct ContentView: View { var body: some View { NavigationView { List { NavigationLink("To Retain Cycle") { RetainCycleView() } } .navigationTitle("Retain Cycle Demo") } .navigationViewStyle(.stack) } } struct RetainCycleView: View { @StateObject var model = Retainer() // @State var enteredText: String = "" var body: some View { VStack(alignment: .leading, spacing: 4) { Text("Navigate back to the previous view.") Text("You will see that 'Retainer' was NOT deallocated.") Text("(it's deinit function prints deallocing Retainer)") .font(.callout) } .padding() .searchable(text: $model.enteredText) // ^---- retain cycle // .searchable(text: $enteredText) // ^---- no retain cycle when using the @State var } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } class Retainer: ObservableObject { @Published var enteredText: String = "" init() { print("instantiated Retainer") } deinit { print("deallocing Retainer") } } I filed feedback but I am not entirely sure that this isn't me making some mistake ... Please help me
4
1
1.1k
1d
PDFView left-anchors to window edge instead of centering between sidebar and inspector (macOS Tahoe)
I'm building a document viewer on macOS Tahoe with a 3-column NSSplitViewController (sidebar | detail | inspector), trying to replicate how Preview displays PDFs with the page centered in the visible gap between the panels, with content bleeding under them when panning or zooming. I'm using the approach from Build an AppKit app with the new design (WWDC25): detailItem.automaticallyAdjustsSafeAreaInsets = true safeAreaInsets reports the correct values (e.g. left: 208, right: 240), and the frame does extend under both panels. But PDFView with autoScales = true anchors the page to the left edge of the window instead of centering it in the visible gap between the sidebar and inspector. I can get the page to center correctly by constraining PDFView to view.safeAreaLayoutGuide, but then content no longer extends under the panels when panning or zooming, which defeats the whole purpose. What's the correct way to center PDFView content within the visible gap while keeping the frame full-width so content bleeds under the panels? I've attached pictures of how Preview does it.
Topic: UI Frameworks SubTopic: AppKit
1
0
129
1d
Change to safe area logic on iOS 26
I have a few view controllers in a large UIKit application that previously started showing content right below the bottom of the top navigation toolbar. When testing the same code on iOS 26, these same views have their content extend under the navigation bar and toolbar. I was able to fix it with: if #available(iOS 26, *, *) { self.edgesForExtendedLayout = [.bottom] } when running on iOS 26. I also fixed one or two places where the main view was anchored to self.view.topAnchor instead of self.view.safeAreaLayoutGuide.topAnchor. Although this seems to work, I wonder if this was an intended change in iOS 26 or just a temporary bug in the beta that will be resolved. Were changes made to the safe area and edgesForExtendedLayout logic in iOS 26? If so, is there a place I can see what the specific changes were, so I know my code is handling it properly? Thanks!
Topic: UI Frameworks SubTopic: UIKit
8
6
2.1k
1d
Picker text wrapping
I have written an app where the user can select a golf course from a picker list. In the simulator the list of courses is displayed as expected with one course name per line however when I run the app on my phone the course names are being wrapped onto a second line. e.g. simulator Collier Park Lakes Pines iPhone Collier Park Lakes Pines I'm new to app development so I apologise if the answer is obvious but how can I get the iPhone behaviour to be the same as the simulator (iPhone 17 Pro Max in both cases). Thanks in advance for any suggestions. XCODE 26
Topic: UI Frameworks SubTopic: SwiftUI
3
0
148
1d
Glass effect interactive effect issue when used with concentric shapes
Using .glassEffect(.clear.interactive(), in: shape), where shape is some concentric shape that adapts to corner radius of the device, results in appearing of highlighted capsule shape. Code to reproduce this behavior import SwiftUI struct HelloLiquidGlass: View { var body: some View { if #available(iOS 26.0, *) { Text("Hello, World!") .frame(maxWidth: .infinity, maxHeight: .infinity) // .glassEffect(.clear.interactive(), in: .rect(corners: .concentric)) // .glassEffect(.clear.interactive(), in: ConcentricRectangle(uniformTopCorners: .fixed(80))) .padding(36) .ignoresSafeArea() .preferredColorScheme(.dark) } } } #Preview { HelloLiquidGlass() } Either of both commented-out modifiers produces the same result when user interacts with Liquid Glass pane (revealing of capsule shape that is not relative to actual shape of liquid glass effect modifier) iOS 26.5 (23F73) SDK + iOS 26.5 (23F77) Simulator
1
0
127
2d
Charging limit misalignment, 80% limit vs 94% real life battery
I was recently charging my macbook, just like any normal time i do. i expected to see the battery at 80%, but the macbook was hiding a surprise for me. the magsafe glowed amber, so i knew it cant be on 80%, so when i opened the lid, the surprise was a shocking 94%. I didn't know what to expect, but my macbook is running macOS tahoe 26.5, so everything seemed normal to me until: someone please help in fixing this bug, as it isn't the first time this happens to me. please link this to my magsafe 4 idea here, as the magsafe could activate pulsing amber (1 second on 1 second off, for both amber and yellow pulsing lights) in case of failure to stop on set limit, making it visually much easier to understand if there is an issue.
Topic: UI Frameworks SubTopic: General Tags:
2
0
134
2d
error: A NavigationLink is presenting a value of type “String” but there is no matching navigationDestination
please help, i am new to SWIFTUI getting an error: A NavigationLink is presenting a value of type “String” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. struct debug_navigation_3: View { @State private var path = NavigationPath() @StateObject private var debug_Client_Lead_Data_ListVM = Debug_Client_Lead_Data_List_Model() var body: some View { NavigationStack(path:$path) { VStack { List(debug_Client_Lead_Data_ListVM.Debug_Client_Lead_Data_Rows, id: \.self) { curr_clientLeadRequest in NavigationLink(curr_clientLeadRequest.Client_Message, value: curr_clientLeadRequest.Client_Message) } } .navigationDestination(for:Debug_Client_Lead_Data.self) { curr_clientLeadRequest in debug_navigation_3_DetailView(rec_id: Int64(curr_clientLeadRequest.id)) } } .onAppear() { Task { await debug_Client_Lead_Data_ListVM.search(rec_id:Int64(0)) //bring all REST API } } } } // data model import Foundation struct Debug_Client_Lead_Data_Response: Decodable { let Debug_Client_Lead_Data_Rows: [Debug_Client_Lead_Data] private enum CodingKeys: String, CodingKey { case Debug_Client_Lead_Data_Rows = "rows" // root tag: REST API } } struct Debug_Client_Lead_Data: Decodable, Hashable, Identifiable { let id:Int32 let Client_Message: String private enum CodingKeys: String, CodingKey { case id = "id" case Client_Message = "Client_Message" } } //list view model import Foundation @MainActor class Debug_Client_Lead_Data_List_Model: ObservableObject { @Published var Debug_Client_Lead_Data_Rows: [Debug_Client_Lead_Data_ListViewModel] = [] func search(rec_id:Int64) async { do { let Debug_Client_Lead_Data_Rows = try await Webservice_debug_client_lead_data().getClientLeadRequestSummary(rec_id:rec_id) // '0' optional self.Debug_Client_Lead_Data_Rows = Debug_Client_Lead_Data_Rows.map(Debug_Client_Lead_Data_ListViewModel.init) } catch { print(error) } } } struct Debug_Client_Lead_Data_ListViewModel: Identifiable, Hashable { let debug_Client_Lead_Data: Debug_Client_Lead_Data var id:Int32 { debug_Client_Lead_Data.id } var Client_Message: String { debug_Client_Lead_Data.Client_Message } } //REST API import Foundation class Webservice_debug_client_lead_data { func getClientLeadRequestSummary(rec_id:Int64) async throws -> [Debug_Client_Lead_Data] { var components = URLComponents() components.scheme = Global_REST_API_URL_HTTP components.host = Global_REST_API_URL components.port = Global_REST_API_URL_port components.path = "/GetClientLeadRequest" components.queryItems = [ URLQueryItem(name: "rec_id", value: String(rec_id)) // Optional, pass '0' for all rows ] guard let url = components.url else { throw NetworkError.badURL } let (data, response) = try await URLSession.shared.data(from: url) guard (response as? HTTPURLResponse)?.statusCode == 200 else {throw NetworkError.badID } let Debug_Client_Lead_Data_Response = try? JSONDecoder().decode(Debug_Client_Lead_Data_Response.self, from: data) return Debug_Client_Lead_Data_Response?.Debug_Client_Lead_Data_Rows ?? [] } }
Topic: UI Frameworks SubTopic: SwiftUI
1
0
199
2d
Liquid Glass toolbar behavior changed in iOS 26.3/26.4?
I’ve been doing a deep dive into Liquid Glass behavior across iOS 26 releases and noticed what appears to be a significant behavior change between ~26.2 and 26.3/26.4. In earlier iOS 26 builds, toolbar/navigation bar glass appeared to adapt to the content behind it. In tinted mode, the glass would become frostier/lighter/darker depending on the backdrop. As of 26.3/26.4, toolbar glass behavior now appears tied to overall device appearance (light/dark) rather than the underlying content. This now closely matches the behavior of sheets (which have always ignored the background, and have been tinted light/dark based on the device appearance). However, the bigger issue: There does not appear to be any public API to make custom Liquid Glass controls participate in the same rendering/compositing behavior as true toolbar/navigation items. For example: .glassEffect() custom floating ornaments vertical stacks of controls over a map Do not visually behave the same way as: navigation bar buttons / toolbar items the sheet Even when using the same materials/effects. So currently there seems to be no way to create floating controls that visually harmonize with system toolbar glass behavior. Example use case: map-heavy UI vertical floating tool stack on the trailing edge wanting the controls to match toolbar. Questions: Was the toolbar adaptation behavior intentionally changed in 26.3/26.4? Is there any public API planned for custom Liquid Glass controls to participate in the same adaptation/compositing pipeline as toolbar/nav items? Is the expectation that developers should treat: toolbar/nav glass custom glass overlays as intentionally different visual systems? Would love clarification here because there's now a gap between system-owned glass and developer-created glass.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
112
2d
NSInvalidArgumentException while sharing in UIDocumentInteractionController
According to our crash analytics, the application crashes when trying to share a PDF file in the UIDocumentInteractionController. This crash takes place on iOS 26+ only. Based on analytics, user sessions end when the pdf file is opened in the UIDocumentInteractionController. We couldn't reproduce it on a physical device or a simulator. Can you please help with a fix or at least workaround for this issue? What's your opinion for bug localization (application or framework)? Crash log is attached below. CoreFoundation __exceptionPreprocess + 164 libobjc.A.dylib objc_exception_throw + 88 CoreFoundation -[__NSArrayM insertObject:atIndex:] + 1276 ShareSheet __79-[SHSheetActivityItemsManager loadItemProvidersForRequest:activity:completion:]_block_invoke + 972 ShareSheet __79-[_UIShareServiceActivityProxy _loadItemProvidersFromActivityItems:completion:]_block_invoke + 88 ShareSheet __74+[UIActivity _loadItemProvidersFromActivityItems:withCacheURL:completion:]_block_invoke_4 + 352 libdispatch.dylib _dispatch_call_block_and_release + 32 libdispatch.dylib _dispatch_main_queue_drain.cold.5 + 812 libdispatch.dylib _dispatch_main_queue_drain + 180 CoreFoundation __CFRunLoopRun + 1944
2
0
148
2d
Auto Navigation to Host App
I have a barcode scanning app with keyboard extesnion. The keyboard has an option to open the app for barcode scanning app(Barcode Button as in the screenshot). After the scanning is done it will take the result back to host application. If you see the attached screenshot , we are asking the end user to navigate back to host application by clicking on the button at top left corner. Isn't it possible to auto navigate after the scanning is done by getting the host bundle ID.
0
0
22
2d
Is the MapKit Legal Notice required for displaying my own content?
If an application utilizes MapKit exclusively to render custom content via MKTileOverlay (with canReplaceMapContent = true to entirely suppress Apple’s default map layers), are developers still contractually or technically mandated to display Apple's default "Legal" link? Currently, the hardcoded Apple attribution document details extensive copyright disclaimers for data suppliers like TomTom, Acxiom, and Breezometer. When an application renders entirely standalone, proprietary, or open-source map tiles, displaying this link creates two distinct issues: User Confusion: It incorrectly implies to end-users that the custom data being viewed is sourced from or validated by Apple's third-party data partners. Attribution Inaccuracy: It forces the display of entirely irrelevant copyright data while doing a disservice to the actual copyright holders of the active custom tile layers, who require their own distinct, prominent on-screen credit. It would be a significant UX improvement if the framework could dynamically hide the global data attribution link when canReplaceMapContent is active, allowing developers to provide accurate, context-specific legal text for the data layers actually in use.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
122
Activity
2h
ViewBridge to RemoteViewService Terminated (...)
After updating to Sonoma, the following is logged in the Xcode console when an editable text field becomes key. This doesn't occur on any text field, but it seems to happen when the text field is within an NSPopover or an NSSavePanel. ViewBridge to RemoteViewService Terminated: Error Domain=com.apple.ViewBridge Code=18 "(null)" UserInfo={com.apple.ViewBridge.error.hint=this process disconnected remote view controller -- benign unless unexpected, com.apple.ViewBridge.error.description=NSViewBridgeErrorCanceled} What does this mean?
Topic: UI Frameworks SubTopic: AppKit
Replies
11
Boosts
9
Views
3.8k
Activity
8h
UIRequiresFullScreen Deprecation
I work on a universal app that targets both iPhone and iPad. Our iPad app currently requires full screen. When testing on the latest iPadOS 26 beta, we see the following warning printed to the console: Update the Info.plist: 1) `UIRequiresFullScreen` will soon be ignored. 2) Support for all orientations will soon be required. It will take a fair amount of effort to update our app to properly support presentation in a resizable window. We wanted to gauge how urgent this change is. Our testing has shown that iPadOS 26 supports our app in a non-resizable window. Can someone from Apple provide any guidance as to how soon “soon” is? Will UIRequiresFullScreen be ignored in iPadOS 26? Will support for all orientations be required in iPadOS 26?
Replies
10
Boosts
4
Views
1.6k
Activity
8h
Programatically adding to a TextField and moving the TextSelection point in SwiftUI
Hi! I am trying to create a simple SwiftUI TextField, with an external button to add text to the field at the current insertion point (the cursor in the TextField). When I add the text, the cursor (I-Beam) remains at the original insertion point, so I want it to move over to the end of what I added. The trouble is, it sometimes moves further forward or to the end (visibly) but works as if it is still at the point I moved it to. This seems to possibly be due to emojis in the TextField (because, I assume, they are composed of more bytes). Further, sometimes the addition of the text can cause an emoji to appear unexpectedly, I assume because it is combining the bytes in an odd way. So moving the cursor seems to sometimes introduce weird behaviour. This comes from a much larger project, but I have distilled this down to the smallest example project I could. And I have a video to show how it behaves. Here's the main part of the code, and I'll attach an Xcode project: import SwiftUI struct ContentView: View { @State private var text: String = "abcdef🧁🧁🧁🧁ghijkl" @State private var selectedText: TextSelection? var body: some View { VStack { TextField("", text: $text, selection: $selectedText) .font(.title) Button("Add Z at Insertion Point in TextField") { // Get indices of any selection in the text field let from: String.Index, to: String.Index if let selectedText = selectedText { let indices = selectedText.indices switch indices { case .selection(let range): from = range.lowerBound to = range.upperBound case .multiSelection(let rangeSet): from = rangeSet.ranges.first!.lowerBound to = rangeSet.ranges.first!.upperBound default: from = self.text.endIndex to = self.text.endIndex } } else { from = self.text.endIndex to = self.text.endIndex } guard from <= to && from <= self.text.endIndex else { return } // Insert and update the cursor position self.text.replaceSubrange(from..<to, with: "Z") // Move cursor after the inserted character let newIndex = self.text.index(after: from) selectedText = TextSelection(insertionPoint: newIndex) } } .padding() } } STEPS TO REPRODUCE Run the app. Also view the video as it shows the steps. Put insertion point between c and d. Press the "Add Z" button. Note that Z is placed between c and d. This is great. Put insertion point between h and i. Press the "Add Z" button. Note that Z is placed between h and i. BUT, the insertion point I-beam moves to the end of the string. Press the "Add Z" button again. Z is added where you would have expected based on where the TextSelection insertion point was put, but the flashing I-Beam is still at the end. Press the "Add Z" button again. Same issue. insertion point is being shown at end, but to the button it is between Z and i. OF NOTE, if you use the keyboard and press delete, it deletes from end (where the I-beam is). Now put insertion point between the 4 cupcakes. Press "Add Z" two times. It behaves correctly. Press "Add Z" a third time. It adds a fairy emoji. So, any idea what I am doing wrong? I thought it might be an issue requiring me to update in a background thread, but I tried that, even delaying the update in the thread, but the issue remains. Thanks in advance. Here's a video: https://curmi.name/temp/SimpleTextField%20showing%20issues.mp4 And if it helps, here is the Xcode project: https://curmi.name/temp/SimpleTextfield.zip
Replies
2
Boosts
0
Views
361
Activity
18h
Switch view that digital crown controls
I wonder if there is way to switch the view that the digital crown controls. Like if have a list and a vertical tab view, when the tab displays, I want the crown control the scrolling in the tab. I dont want to use sheet, cause I have some special UX design, and also dont want to use if else to toggle between the two views. I have tried with resetFocus and other focus related functions, not working
Replies
1
Boosts
0
Views
143
Activity
22h
Count of Windows Open in App Switcher on iPadOS? Tried Via UIApplication.sharedApplication.openSessions
I'm trying to get the count of how many windows an iPadOS app has 'open' (open from the user's perspective in the app switcher). This is for the sake of determining whether I should show or hide a button that takes action on every window (if there is only 1 window, the button will be hidden). According to the documentation the proper API for this is this property on UIApplication: // All of the representations that currently have connected UIScene instances or had their sessions persisted by the system (ex: visible in iOS' switcher) @property(nonatomic, readonly) NSSet<UISceneSession *> *openSessions So I print the count (only sessions with role UIWindowSceneSessionRoleApplication) when scenes are added/removed etc via appropriate lifecycle notifications like -sceneDidDisconnect: -sceneDidBecomeActive: and so forth. What I noticed is when I add a new window scene, the count increases by one so cool, that works. But when I kill a window in the App switcher the count does not decrease. I can end up in a situation where the app has only 1 window in the app switcher but the count prints 8, so this is wrong. So am I using the wrong API? How can I just get scene count in the app switcher? The documentation makes it seem like using 'connectedScenes' for this would be wrong because that property is not supposed to include 'archived' scenes in the app switcher (or is it?)? I do know I can't take action on an archived scene 'yet' but I would still show the button because whether or not the scene is archived in the app switcher is a fact that remains hidden from the user. My code will take care of that later after state restoration. Is iPadOS 26 potentially keeping scene sessions open for too long? Is there a good way to reliably detect how many scenes I have in the app switcher? Is a scene session explicitly killed by the user supposed to remain the .openSessions set? I am testing on the Simulator FWIW. iPad 26.5.
Replies
0
Boosts
0
Views
36
Activity
23h
How to handle all the core AppleEvents
Glancing through the APIs, SwiftUI can handle the open app, reopen app, open doc, and quit core events (with the “aevt” suite ID). What about the print doc and open content events? If there are no hooks (yet), how can I implement them the traditional way without clashing with SwiftUI?
Replies
1
Boosts
0
Views
90
Activity
1d
NSTextAttachment view flicker while typing in same paragraph
I using SwiftUI to wrap a NSTextView to support rich text editing. I created a subclass ImageAttachment and provided my own viewProvider and attachmentView. The insertion of the image works fine, but when I typing in the same paragraph of the image, the image will flicker during typing and pause. after typing it sometimes just display nothing, but after refresh or click other places, the image shows. The interesting part is if I typing in other paragraph, the image attachment displays well. I don't think the flicker should happen while typing in the same paragraph of the attachment, but not sure if there is a way to enforce the layout stable for the paragraph?
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
165
Activity
1d
After binding to NSBrowser indexPaths the browser assumes I'm using NSBrowserCell and calls unimplemented methods on my NSCell subclass
So after binding to NSBrowser selectionIndexPaths: https://developer.apple.com/library/archive/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSBrowser.html this causes NSBrowser to do some weird stuff that seems completely unrelated to this particular binding. It starts calling NSBrowserCell methods on my cells but my cell is not a NSBrowserCell. My cell is actually a subclass of NSTextFieldCell. But NSBrowser starts sending setIsLeaf: (which I don't implement). In any case if I implement the -setLeaf: that solves that unrecognized selector, but now my cells don't draw titles. Not sure why binding to selectionIndexPaths causes this behavior? The cell stuff seems unrelated to this particular binding. I am of course using the newer but still pretty old item based APIs... do these bindings only support using NSMatrix? I do set the binding after calling -setCellClass: but makes no difference. I also just tried overriding -setSelectionIndexPaths: but NSBrowser does not use the setter.
Replies
1
Boosts
0
Views
117
Activity
1d
Crash in PDFView / PDFPageAnalyzerV2
Hello. Some users of my app experience crashes that mention PDFKit. I managed to find out what specific PDF file caused the crash and created a sample that demonstrates the issue and created a bug report in Feedback Assistant (FB22409977). Unfortunately I didn't get any answer for over a month, hence I'm writing it here so others can see that this is a known issue. The crash repro sample is very simple, it's just a PDFView that opens a bundled PDF file upon application lanunch. To cause the crash it is only needed to zoom-in and move around the page that has a table. The crash happens when the system tries to do some sort of OCR. The original crash report came from iPhone 11 user running iOS 26.3.1. Recently another user with iPhone 16 Pro Max running 26.5 experienced the same crash. Thread 12 Queue : PDFKWit.PDFDocument.formFillingQueue (serial) #0 0x000000018d320bd8 in PageLayout::GetBoundsForRangeWithinLine () #1 0x000000018d320c88 in PageLayout::GetBoundsForTextRange () #2 0x000000018d393028 in CGPDFTaggedNodeCreateCopyWithStringRange () #3 0x000000018d316630 in invocation function for block in TaggedParser::InsertLinkAnnotationsIntoStructureTree(CGPDFTaggedNode*, CGPDFPage*, PageLayout&) () #4 0x000000018d104f00 in CGPDFPageEnumerateAnnotations () #5 0x000000018d106968 in CGPDFPageCopyRootTaggedNode () #6 0x000000018d106710 in CGPDFPageInsertTableDescriptions () #7 0x00000001957a65b8 in +[PDFPageAnalyzerV2 addTablesFromVisionDocument:documentImage:toPage:withBox:] () #8 0x00000001957a3030 in +[PDFPageAnalyzerV2 analyzePage:withBox:requestTypes:] () #9 0x000000019584c018 in __31-[PDFView visiblePagesChanged:]_block_invoke () When CG_PDF_VERBOSE env variable is set, "New text range needs to be within the original node's text range." warning is printed to console several times before the crash happens.
Replies
1
Boosts
0
Views
123
Activity
1d
SwiftUI retain cycle with .searchable
I'm trying to see what I am doing wrong ... So I created this simple app where the stateobject Retainer won't get deallocated when I pop the view off the stack: import SwiftUI struct ContentView: View { var body: some View { NavigationView { List { NavigationLink("To Retain Cycle") { RetainCycleView() } } .navigationTitle("Retain Cycle Demo") } .navigationViewStyle(.stack) } } struct RetainCycleView: View { @StateObject var model = Retainer() // @State var enteredText: String = "" var body: some View { VStack(alignment: .leading, spacing: 4) { Text("Navigate back to the previous view.") Text("You will see that 'Retainer' was NOT deallocated.") Text("(it's deinit function prints deallocing Retainer)") .font(.callout) } .padding() .searchable(text: $model.enteredText) // ^---- retain cycle // .searchable(text: $enteredText) // ^---- no retain cycle when using the @State var } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } class Retainer: ObservableObject { @Published var enteredText: String = "" init() { print("instantiated Retainer") } deinit { print("deallocing Retainer") } } I filed feedback but I am not entirely sure that this isn't me making some mistake ... Please help me
Replies
4
Boosts
1
Views
1.1k
Activity
1d
PDFView left-anchors to window edge instead of centering between sidebar and inspector (macOS Tahoe)
I'm building a document viewer on macOS Tahoe with a 3-column NSSplitViewController (sidebar | detail | inspector), trying to replicate how Preview displays PDFs with the page centered in the visible gap between the panels, with content bleeding under them when panning or zooming. I'm using the approach from Build an AppKit app with the new design (WWDC25): detailItem.automaticallyAdjustsSafeAreaInsets = true safeAreaInsets reports the correct values (e.g. left: 208, right: 240), and the frame does extend under both panels. But PDFView with autoScales = true anchors the page to the left edge of the window instead of centering it in the visible gap between the sidebar and inspector. I can get the page to center correctly by constraining PDFView to view.safeAreaLayoutGuide, but then content no longer extends under the panels when panning or zooming, which defeats the whole purpose. What's the correct way to center PDFView content within the visible gap while keeping the frame full-width so content bleeds under the panels? I've attached pictures of how Preview does it.
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
129
Activity
1d
Change to safe area logic on iOS 26
I have a few view controllers in a large UIKit application that previously started showing content right below the bottom of the top navigation toolbar. When testing the same code on iOS 26, these same views have their content extend under the navigation bar and toolbar. I was able to fix it with: if #available(iOS 26, *, *) { self.edgesForExtendedLayout = [.bottom] } when running on iOS 26. I also fixed one or two places where the main view was anchored to self.view.topAnchor instead of self.view.safeAreaLayoutGuide.topAnchor. Although this seems to work, I wonder if this was an intended change in iOS 26 or just a temporary bug in the beta that will be resolved. Were changes made to the safe area and edgesForExtendedLayout logic in iOS 26? If so, is there a place I can see what the specific changes were, so I know my code is handling it properly? Thanks!
Topic: UI Frameworks SubTopic: UIKit
Replies
8
Boosts
6
Views
2.1k
Activity
1d
Picker text wrapping
I have written an app where the user can select a golf course from a picker list. In the simulator the list of courses is displayed as expected with one course name per line however when I run the app on my phone the course names are being wrapped onto a second line. e.g. simulator Collier Park Lakes Pines iPhone Collier Park Lakes Pines I'm new to app development so I apologise if the answer is obvious but how can I get the iPhone behaviour to be the same as the simulator (iPhone 17 Pro Max in both cases). Thanks in advance for any suggestions. XCODE 26
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
0
Views
148
Activity
1d
Glass effect interactive effect issue when used with concentric shapes
Using .glassEffect(.clear.interactive(), in: shape), where shape is some concentric shape that adapts to corner radius of the device, results in appearing of highlighted capsule shape. Code to reproduce this behavior import SwiftUI struct HelloLiquidGlass: View { var body: some View { if #available(iOS 26.0, *) { Text("Hello, World!") .frame(maxWidth: .infinity, maxHeight: .infinity) // .glassEffect(.clear.interactive(), in: .rect(corners: .concentric)) // .glassEffect(.clear.interactive(), in: ConcentricRectangle(uniformTopCorners: .fixed(80))) .padding(36) .ignoresSafeArea() .preferredColorScheme(.dark) } } } #Preview { HelloLiquidGlass() } Either of both commented-out modifiers produces the same result when user interacts with Liquid Glass pane (revealing of capsule shape that is not relative to actual shape of liquid glass effect modifier) iOS 26.5 (23F73) SDK + iOS 26.5 (23F77) Simulator
Replies
1
Boosts
0
Views
127
Activity
2d
Charging limit misalignment, 80% limit vs 94% real life battery
I was recently charging my macbook, just like any normal time i do. i expected to see the battery at 80%, but the macbook was hiding a surprise for me. the magsafe glowed amber, so i knew it cant be on 80%, so when i opened the lid, the surprise was a shocking 94%. I didn't know what to expect, but my macbook is running macOS tahoe 26.5, so everything seemed normal to me until: someone please help in fixing this bug, as it isn't the first time this happens to me. please link this to my magsafe 4 idea here, as the magsafe could activate pulsing amber (1 second on 1 second off, for both amber and yellow pulsing lights) in case of failure to stop on set limit, making it visually much easier to understand if there is an issue.
Topic: UI Frameworks SubTopic: General Tags:
Replies
2
Boosts
0
Views
134
Activity
2d
error: A NavigationLink is presenting a value of type “String” but there is no matching navigationDestination
please help, i am new to SWIFTUI getting an error: A NavigationLink is presenting a value of type “String” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. struct debug_navigation_3: View { @State private var path = NavigationPath() @StateObject private var debug_Client_Lead_Data_ListVM = Debug_Client_Lead_Data_List_Model() var body: some View { NavigationStack(path:$path) { VStack { List(debug_Client_Lead_Data_ListVM.Debug_Client_Lead_Data_Rows, id: \.self) { curr_clientLeadRequest in NavigationLink(curr_clientLeadRequest.Client_Message, value: curr_clientLeadRequest.Client_Message) } } .navigationDestination(for:Debug_Client_Lead_Data.self) { curr_clientLeadRequest in debug_navigation_3_DetailView(rec_id: Int64(curr_clientLeadRequest.id)) } } .onAppear() { Task { await debug_Client_Lead_Data_ListVM.search(rec_id:Int64(0)) //bring all REST API } } } } // data model import Foundation struct Debug_Client_Lead_Data_Response: Decodable { let Debug_Client_Lead_Data_Rows: [Debug_Client_Lead_Data] private enum CodingKeys: String, CodingKey { case Debug_Client_Lead_Data_Rows = "rows" // root tag: REST API } } struct Debug_Client_Lead_Data: Decodable, Hashable, Identifiable { let id:Int32 let Client_Message: String private enum CodingKeys: String, CodingKey { case id = "id" case Client_Message = "Client_Message" } } //list view model import Foundation @MainActor class Debug_Client_Lead_Data_List_Model: ObservableObject { @Published var Debug_Client_Lead_Data_Rows: [Debug_Client_Lead_Data_ListViewModel] = [] func search(rec_id:Int64) async { do { let Debug_Client_Lead_Data_Rows = try await Webservice_debug_client_lead_data().getClientLeadRequestSummary(rec_id:rec_id) // '0' optional self.Debug_Client_Lead_Data_Rows = Debug_Client_Lead_Data_Rows.map(Debug_Client_Lead_Data_ListViewModel.init) } catch { print(error) } } } struct Debug_Client_Lead_Data_ListViewModel: Identifiable, Hashable { let debug_Client_Lead_Data: Debug_Client_Lead_Data var id:Int32 { debug_Client_Lead_Data.id } var Client_Message: String { debug_Client_Lead_Data.Client_Message } } //REST API import Foundation class Webservice_debug_client_lead_data { func getClientLeadRequestSummary(rec_id:Int64) async throws -> [Debug_Client_Lead_Data] { var components = URLComponents() components.scheme = Global_REST_API_URL_HTTP components.host = Global_REST_API_URL components.port = Global_REST_API_URL_port components.path = "/GetClientLeadRequest" components.queryItems = [ URLQueryItem(name: "rec_id", value: String(rec_id)) // Optional, pass '0' for all rows ] guard let url = components.url else { throw NetworkError.badURL } let (data, response) = try await URLSession.shared.data(from: url) guard (response as? HTTPURLResponse)?.statusCode == 200 else {throw NetworkError.badID } let Debug_Client_Lead_Data_Response = try? JSONDecoder().decode(Debug_Client_Lead_Data_Response.self, from: data) return Debug_Client_Lead_Data_Response?.Debug_Client_Lead_Data_Rows ?? [] } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
199
Activity
2d
Liquid Glass toolbar behavior changed in iOS 26.3/26.4?
I’ve been doing a deep dive into Liquid Glass behavior across iOS 26 releases and noticed what appears to be a significant behavior change between ~26.2 and 26.3/26.4. In earlier iOS 26 builds, toolbar/navigation bar glass appeared to adapt to the content behind it. In tinted mode, the glass would become frostier/lighter/darker depending on the backdrop. As of 26.3/26.4, toolbar glass behavior now appears tied to overall device appearance (light/dark) rather than the underlying content. This now closely matches the behavior of sheets (which have always ignored the background, and have been tinted light/dark based on the device appearance). However, the bigger issue: There does not appear to be any public API to make custom Liquid Glass controls participate in the same rendering/compositing behavior as true toolbar/navigation items. For example: .glassEffect() custom floating ornaments vertical stacks of controls over a map Do not visually behave the same way as: navigation bar buttons / toolbar items the sheet Even when using the same materials/effects. So currently there seems to be no way to create floating controls that visually harmonize with system toolbar glass behavior. Example use case: map-heavy UI vertical floating tool stack on the trailing edge wanting the controls to match toolbar. Questions: Was the toolbar adaptation behavior intentionally changed in 26.3/26.4? Is there any public API planned for custom Liquid Glass controls to participate in the same adaptation/compositing pipeline as toolbar/nav items? Is the expectation that developers should treat: toolbar/nav glass custom glass overlays as intentionally different visual systems? Would love clarification here because there's now a gap between system-owned glass and developer-created glass.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
112
Activity
2d
NSInvalidArgumentException while sharing in UIDocumentInteractionController
According to our crash analytics, the application crashes when trying to share a PDF file in the UIDocumentInteractionController. This crash takes place on iOS 26+ only. Based on analytics, user sessions end when the pdf file is opened in the UIDocumentInteractionController. We couldn't reproduce it on a physical device or a simulator. Can you please help with a fix or at least workaround for this issue? What's your opinion for bug localization (application or framework)? Crash log is attached below. CoreFoundation __exceptionPreprocess + 164 libobjc.A.dylib objc_exception_throw + 88 CoreFoundation -[__NSArrayM insertObject:atIndex:] + 1276 ShareSheet __79-[SHSheetActivityItemsManager loadItemProvidersForRequest:activity:completion:]_block_invoke + 972 ShareSheet __79-[_UIShareServiceActivityProxy _loadItemProvidersFromActivityItems:completion:]_block_invoke + 88 ShareSheet __74+[UIActivity _loadItemProvidersFromActivityItems:withCacheURL:completion:]_block_invoke_4 + 352 libdispatch.dylib _dispatch_call_block_and_release + 32 libdispatch.dylib _dispatch_main_queue_drain.cold.5 + 812 libdispatch.dylib _dispatch_main_queue_drain + 180 CoreFoundation __CFRunLoopRun + 1944
Replies
2
Boosts
0
Views
148
Activity
2d
Auto Navigation to Host App
I have a barcode scanning app with keyboard extesnion. The keyboard has an option to open the app for barcode scanning app(Barcode Button as in the screenshot). After the scanning is done it will take the result back to host application. If you see the attached screenshot , we are asking the end user to navigate back to host application by clicking on the button at top left corner. Isn't it possible to auto navigate after the scanning is done by getting the host bundle ID.
Replies
0
Boosts
0
Views
22
Activity
2d