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

Resizing text to fit available space
My app displays some text that should appear the same regardless of the container view or window size, i.e. it should grow and shrink with the container view or window. On iOS there is UILabel.adjustsFontSizeToFitWidth but I couldn't find any equivalent API on macOS. On the internet some people suggest to iteratively set a smaller font size until the text fits the available space, but I thought there must be a more efficient solution. How does UILabel.adjustsFontSizeToFitWidth do it? My expectation was that setting a font's size to a fraction of the window width or height would do the trick, but when resizing the window I can see a slightly different portion of it. class ViewController: NSViewController { override func loadView() { view = MyView(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) NSLayoutConstraint.activate([view.widthAnchor.constraint(equalTo: view.heightAnchor, multiplier: 3), view.heightAnchor.constraint(greaterThanOrEqualToConstant: 100)]) } } class MyView: NSView { let textField = NSTextField(labelWithString: String(repeating: "a b c d e f g h i j k l m n o p q r s t u v w x y z ", count: 2)) override init(frame frameRect: NSRect) { super.init(frame: frameRect) textField.translatesAutoresizingMaskIntoConstraints = false textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) addSubview(textField) NSLayoutConstraint.activate([textField.topAnchor.constraint(equalTo: topAnchor), textField.leadingAnchor.constraint(equalTo: leadingAnchor), textField.trailingAnchor.constraint(equalTo: trailingAnchor)]) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func resize(withOldSuperviewSize oldSize: NSSize) { // textField.font = .systemFont(ofSize: frame.width * 0.05) textField.font = .systemFont(ofSize: frame.height * 0.1) } }
Topic: UI Frameworks SubTopic: AppKit Tags:
7
0
112
4d
No dynamic guide available for the underlying `_UITabBarPlatterView`?
The new UITabBarController APIs are great! But they leave a lot to be desired. For example, let's say I want a bottom accessory – one simple enough that it could be a UIBarButtonItem. The UITabAccessoryAPI only takes UIViews but passing a simple UIVIew or UIButton will create a new problem: now the view is stretched to be huge instead of a tiny little image-button. New approach: Show it on screen as a contextual overlay modal thing. I can do that, no problem. New problem: It won't animate down when the tab bar minimizes, like the bottom accessory does; there is no layout guide exposed that allows us to hook into this. I'd really rather not reverse engineer to grab the platter when the state is minimized and set some funky layout constraints to adapt to it, determine that it can fit (a bit irrelevant in this instance, since it's a single button), and animate into place as the tab bar animates. I know there's a new contentLayoutGuide, but it doesn't seem there's anything like what I'm looking for here. I basically just want a tab accessory view, but I don't want to commit to it being so huge. And what happens if I want multiple views here? Suddenly, this opens up the toolbar, but… having a toolbar and a tab bar in the same app is an exercise in frustration, since the tab bar will cover up the toolbar. In a different environment, I may have gone ahead and just wrapped my own UITabBar, as Steve Troughton-Smith does via his Mastodon post (can't link directly). That presents another host of issues though: iPad behavior goes out the window. I'd probably still have to dig into private APIs to get a magic pocket effect that works the same as the UITabBarController's! UIScrollEdgeElementContainerInteraction doesn't behave exactly the same as the interaction added to the tab bar by the tab bar controller. Is there any such API for this? What possible reason could there be for keeping these APIs private?
Topic: UI Frameworks SubTopic: UIKit
0
0
79
4d
PressBegan() invoked twice when pressing Command + key on UITextView/UITextField
I am observing an unexpected behavior with external keyboard input on iOS. When I press Command + key (e.g., ⌘ + J) while a UITextView is focused, the system invokes pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) twice: -> Once with the key press event without any modifier flags. -> A second time with the same key event but including the Command modifier flag. This behavior is checked on an iPad with an external keyboard. Additionally, I noticed that textView(_:shouldChangeTextIn:replacementText:) is not invoked in this case, even if I call super.pressesBegan for event propagation. Questions: Is it expected that pressesBegan fires twice for a Command + key combination? If so, what is the recommended way to distinguish between these two invocations? Should the UITextView delegate methods (like shouldChangeTextIn) be triggered for such key combinations, or is this by design?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
81
4d
HideAllTips launch argument does not work in xctestplan
The launch argument -com.apple.TipKit.HideAllTips 1 does not work if it is defined in xctestplan arguments passed on launch. I tested it with the apple provided example app, where I created simple UI test and added xctestplan with launch argument -com.apple.TipKit.HideAllTips 1. The app does not hide the tips when it is running the UI Tests. Is there any solution that works? Thanks for reply.
2
0
43
4d
debugDescription missing from UIToolbar
Starting from iOS 26 simulator (beta 7), I could not see any debugDescription from UIToolbar. The Accessibility Inspector tool could not see anything beneath the toolbar even if we can see elements like static texts and buttons on the simulator. When the same app is run on an iOS 18.2 simulator, the debugDescription for elements under a UIToolbar is available. Is the absence of debugDescription for UIToolbar a bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
76
4d
iOS 26 beta: Long‑pressing UIButton in UITableView cell triggers pull‑to‑dismiss on presented controller
I’m seeing what looks like a regression on iOS 26 beta where a presented view controller dismisses when a user long‑presses a button inside a table view cell and drags downward. Steps to reproduce Present a UIViewController modally. The controller contains a UITableView; each cell has a UIButton. Long‑press and hold the UIButton in any cell. While still holding, drag downward. Expected The button and/or table view handle the gesture; no interactive dismissal starts. Actual The system recognizes a pull‑to‑dismiss gesture and begins dismissing the presented controller. Notes Reproducible only on iOS 26 beta. Not observed on earlier iOS versions in my testing. Happens on both simulator and device (beta). Environment iOS: 26 beta (please see exact build)
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
53
4d
tabViewBottomAccessory selective hidden bug
import SwiftUI struct ContentView: View { @State private var selection = 1 var body: some View { TabView(selection: $selection) { Tab("1", systemImage: "1.circle", value: 1) { Text("Tab 1") } Tab("2", systemImage: "2.circle", value: 2) { Text("Tab 2") } } .tabViewBottomAccessory { if selection == 1 { Text("Bottom Bar for Tab 1") } } } } With this structure, I'm supposing when I select tab 2, the bottom accessory will be hidden, but it is not hidden for the first time, after I click back to tab 1, then click tab 2, it is hidden. I think this is a bug?
0
0
58
4d
Adaptation of UIScrollEdgeElementContainerInteraction in UITableView
When I set up UIScrollEdgeElementContainerInteraction for a UITableView in iOS 26 like this: let interaction = UIScrollEdgeElementContainerInteraction() interaction.scrollView = tableView interaction.edge = .top viewHeader.addInteraction(interaction) the section header remains displayed above the gradient glass effect, but the cells do not exhibit this issue. Visually, the cells appear beneath the glass layer, while the header appears above the glass layer—even though, in reality, both the header and the cells are positioned below the glass layer in the view hierarchy.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
63
5d
Changing the color of SwiftUI Link
Hi, I have trouble changing the color of the text of Link in SwiftUI. I tried with this code: Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) .foregroundColor(Color.green) and this code: HStack(spacing: 0) { Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) } .foregroundColor(Color.green) The link keeps getting the accent color. EDIT: I want to add that it used to work and I think the issue came with a beta of Xcode 26. I think that was around the beta 4 or beta 5. Is it a change of the APIs or a bug?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
72
5d
How to use iOS15-specific modifiers in SwiftUI on iOS 14 and earlier?
There are many new iOS15-specific modifiers that were added in SwiftUI. For example, we have a .focused() modifier, which can be used like this: TextField("Username", text: $username) .focused($focusedField, equals: .username) However, this code fails to compile if the app supports iOS 14 and earlier. How can I make this code to compile? Ideally, I'd like to do something like this: TextField("Username", text: $username) #if os(iOS, 15.0, *) .focused($focusedField, equals: .username) #endif But obviously this won't work because #if os() can only specify the target OS, not the version.. Thanks!
3
0
5.9k
5d
iOS 26 | UIBarButtonItem UI issues with isEnabled and hidesSharedBackground
UIBarButtonItem setting isEnabled = false, but the item is still tappable and animating. Is this a new UI behavior or an issue? Do the following steps: On tapping on a UIBarButtonItem, disable by setting isEnabled = false and setting hidesSharedBackground = true Enable the button by setting isEnabled = true and setting hidesSharedBackground = false => The button appears with bigger shared background is this an issue? please find the attachments for more details. ViewController.swift.txt
1
1
190
5d
tabBarMinimizeBehavior no longer working after upgrading to Xcode 16 beta 5 / iOS 18 beta 5
Hello! The minimize behavior was working correctly while I was using Xcode 26 beta 4 with iOS 26 beta 4 simulator — when scrolling down, the Tab Bar would minimize as expected. However, after upgrading both Xcode and iOS simulator to beta 5, the tabBarMinimizeBehavior setting no longer has any visible effect — the Tab Bar stays fixed in place. Code snippet: if #available(iOS 26.0, *) { self.tabBarMinimizeBehavior = .onScrollDown } Steps to reproduce: 1. Create a UITabBarController with at least one tab containing a scrollable view (e.g., UITableView). 2. In viewDidLoad, set tabBarMinimizeBehavior to .onScrollDown. 3. Run on iOS 26 beta 5 simulator. Expected behavior (beta 4): Scrolling down hides/minimizes the Tab Bar with animation. Actual behavior (beta 5): Tab Bar remains fixed; no minimize animation is triggered. Environment: • Xcode 26 beta 5 (Build: 17A5295f) • iOS 26 beta 5 simulator (Build: 1055) – iPhone 16 Pro • Also tested on iPhone 13 mini – iOS 26 (Build: 23A5308g)
3
1
157
5d
iOS 26 Beta 9 dark/light behaviour over custom UIViews in UITabBarController and CPMapTemplate
I have an app where the user can choose if the dark / light mode is enabled automatically during the night / day (dusk and dawn times are calculated according to to the date and location of the user). I also have an UITabBarController, with two tabs which have a GMSMapView (Google Map View from their SDK), and three tabs with UITableViews. I have noticed that when the automatic change of dark / light mode is performed from dark to light mode, and the user is in a tab with GMSMapView, the tabBar does not change to light model, it remains in dark mode. I perform the switch by setting the self.window.overrideUserInterfaceStyle of the UIWindow of the UIScene. All the views change to light mode, including the navigation bar, but not the tab bar. If I move between the tabs with GMSMapView, the tabBar stays in dark mode. As soon as I move to a tab which contains a UITableView, the tabBar switches to light mode. If the switch to light mode is performed while the user is in tab with the UITableViews, the tabBar switches to light mode immediately, as expected. When moving to the tabs with the GMSMapViews, the tabBar stays in light mode, also as expected. I have also noticed the same problem in CarPlay, in CPMapTemplate (with a UIViewController whose view is GMSMapView), in the buttons with are set with the property “mapButtons”, and with the panning buttons. When the switch from dark mode to light mode is performed by setting the self.window.overrideUserInterfaceStyle of the UIWindow of CarPlay scene, the mapButtons keeps the glyphs in white, and set the background of the buttons to almost white, so the glyphs are barely visible unless you put png images on them instead of SF Symbols. With the panning buttons there is not workaround, since you cannot set custom images for the panning buttons. This happens even if the panning buttons are not being displayed when the switch is performed to light mode, and you enable them later. Is this a bug? Why does this only happen with view over GMSMapView (Google Maps view for a map from their SDK)? Can you think of any viable workaround? Thank you.
2
0
173
5d
UIMenuBuilder - some menus refuse customization
I'm trying to customize the menu in my iPad app for iOS 26, since most of the default menu options aren't relevant to my app. Fortunately, I already have the code for this from my Mac Catalyst implementation. However, the functionality to replace menus with new sets of options has no effect on some menus on iOS. For example, updating the Format menu works fine on Mac Catalyst and iOS 26: override func buildMenu(with builder: UIMenuBuilder) { super.buildMenu(with: builder) let transposeUpItem = UIKeyCommand(title: NSLocalizedString("TRANSPOSE_UP"), image: nil, action: #selector(TransposeToolbar.transposeUp(_:)), input: "=", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let transposeDownItem = UIKeyCommand(title: NSLocalizedString("TRANSPOSE_DOWN"), image: nil, action: #selector(TransposeToolbar.transposeDown(_:)), input: "-", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let transposeGroup = UIMenu(title: "", image: nil, identifier: UIMenu.Identifier(rawValue: "transposeGroup"), options: UIMenu.Options.displayInline, children: [transposeUpItem, transposeDownItem]) let boldItem = UIKeyCommand(title: NSLocalizedString("BOLD"), image: nil, action: #selector(FormatToolbar.bold), input: "b", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let italicItem = UIKeyCommand(title: NSLocalizedString("ITALIC"), image: nil, action: #selector(FormatToolbar.italic), input: "i", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let underlineItem = UIKeyCommand(title: NSLocalizedString("UNDERLINE"), image: nil, action: #selector(FormatToolbar.underline), input: "u", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let colorItem = UIKeyCommand(title: NSLocalizedString("COLOR"), image: nil, action: #selector(FormatToolbar.repeatColor), input: "c", modifierFlags: [.command, .alternate], propertyList: nil, alternates: []) let clearItem = UIKeyCommand(title: NSLocalizedString("CLEAR_FORMATTING"), image: nil, action: #selector(FormatToolbar.clear), input: "x", modifierFlags: [.command, .alternate], propertyList: nil, alternates: []) let formatGroup = UIMenu(title: "", image: nil, identifier: UIMenu.Identifier(rawValue: "formatGroup"), options: UIMenu.Options.displayInline, children: [boldItem, italicItem, underlineItem, colorItem, clearItem]) let markerItem = UIKeyCommand(title: NSLocalizedString("ADD_A_MARKER"), image: nil, action: #selector(FormatToolbar.marker), input: "m", modifierFlags: [.command, .alternate], propertyList: nil, alternates: []) let markerGroup = UIMenu(title: "", image: nil, identifier: UIMenu.Identifier(rawValue: "markerGroup"), options: UIMenu.Options.displayInline, children: [markerItem]) var formatMenu = builder.menu(for: .format) var formatItems = [transposeGroup, formatGroup, markerGroup] formatMenu = formatMenu?.replacingChildren(formatItems) if let formatMenu = formatMenu { builder.replace(menu: .format, with: formatMenu) } } The same approach for the View menu works fine on Mac Catalyst, but has no effect on iOS 26. I see the same View menu options as before: override func buildMenu(with builder: UIMenuBuilder) { super.buildMenu(with: builder) let helpItem = UIKeyCommand(title: NSLocalizedString("HELP"), image: nil, action: #selector(utilityHelp), input: "1", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let actionItemsItem = UIKeyCommand(title: NSLocalizedString("ACTION_ITEMS"), image: nil, action: #selector(utilityActionItems), input: "2", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let remoteControlItem = UIKeyCommand(title: NSLocalizedString("APP_CONTROL_STATUS"), image: nil, action: #selector(utilityRemoteControl), input: "3", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let midiItem = UIKeyCommand(title: NSLocalizedString("MIDI_STATUS"), image: nil, action: #selector(utilityMidi), input: "4", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let linkingItem = UIKeyCommand(title: NSLocalizedString("LIVE_SHARING_STATUS"), image: nil, action: #selector(utilityLinking), input: "5", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let syncItem = UIKeyCommand(title: NSLocalizedString("SYNCHRONIZATION"), image: nil, action: #selector(utilitySync), input: "6", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let settingsItem = UIKeyCommand(title: NSLocalizedString("SETTINGS"), image: nil, action: #selector(utilitySettings), input: "7", modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let utilityGroup = UIMenu(title: "", image: nil, identifier: UIMenu.Identifier(rawValue: "utilityGroup"), options: UIMenu.Options.displayInline, children: [helpItem, actionItemsItem, remoteControlItem, midiItem, linkingItem, syncItem, settingsItem]) let backItem = UIKeyCommand(title: NSLocalizedString("BUTTON_BACK"), image: nil, action: #selector(navigateBack), input: UIKeyCommand.inputLeftArrow, modifierFlags: UIKeyModifierFlags.command, propertyList: nil, alternates: []) let mainMenuItem = UIKeyCommand(title: NSLocalizedString("MAIN_MENU"), image: nil, action: #selector(navigateMain), input: UIKeyCommand.inputLeftArrow, modifierFlags: [.command, .alternate], propertyList: nil, alternates: []) let navigateGroup = UIMenu(title: "", image: nil, identifier: UIMenu.Identifier(rawValue: "navigateGroup"), options: UIMenu.Options.displayInline, children: [backItem, mainMenuItem]) var viewMenu = builder.menu(for: .view) var viewItems = [utilityGroup, navigateGroup] viewMenu = viewMenu?.replacingChildren(viewItems) if let viewMenu = viewMenu { builder.replace(menu: .view, with: viewMenu) } } I tried a couple other approaches, but they also did nothing: var viewMenu = builder.menu(for: .view) var viewItems = [utilityGroup, navigateGroup] builder.replaceChildren(ofMenu: .view, from: { oldChildren in viewItems }) Also: viewMenu = UIMenu(title: NSLocalizedString("VIEW"), image: nil, identifier: .view, options: UIMenu.Options.displayInline, children: viewItems) if let viewMenu = viewMenu { builder.replace(menu: .view, with: viewMenu) } Does anyone know how to make this work for the View menu? It's frustrating that Apple added all these default options, without an easy way to remove options that aren't relevant.
Topic: UI Frameworks SubTopic: UIKit
3
0
302
5d
SwiftUI TextField input is super laggy for SwiftData object
have a SwiftUI View where I can edit financial transaction information. The data is stored in SwiftData. If I enter a TextField element and start typing, it is super laggy and there are hangs of 1-2 seconds between each input (identical behaviour if debugger is detached). On the same view I have another TextField that is just attached to a @State variable of that view and TextField updates of that value work flawlessly. So somehow the hangs must be related to my SwiftData object but I cannot figure out why. This used to work fine until a few months ago and then I could see the performance degrading. I have noticed that when I use a placeholder variable like @State private var transactionSubject: String = "" and link that to the TextField, the performance is back to normal. I am then using .onSubmit { self.transaction.subject = self.transactionSubject } to update the value in the end but this again causes a 1 s hang. :/ Below the original code sample with some unnecessary stuff removed: struct EditTransactionView: View { @Environment(\.modelContext) var modelContext @Environment(\.dismiss) var dismiss @State private var testValue: String = "" @Bindable var transaction: Transaction init(transaction: Transaction) { self.transaction = transaction let transactionID = transaction.transactionID let parentTransactionID = transaction.transactionMasterID _childTransactions = Query(filter: #Predicate<Transaction> {item in item.transactionMasterID == transactionID }, sort: \Transaction.date, order: .reverse) _parentTransactions = Query(filter: #Predicate<Transaction> {item in item.transactionID == parentTransactionID }, sort: \Transaction.date, order: .reverse) print(_parentTransactions) } //Function to keep text length in limits func limitText(_ upper: Int) { if self.transaction.icon.count > upper { self.transaction.icon = String(self.transaction.icon.prefix(upper)) } } var body: some View { ZStack { Form{ Section{ //this one hangs TextField("Amount", value: $transaction.amount, format: .currency(code: Locale.current.currency?.identifier ?? "USD")) //this one works perfectly TextField("Test", text: $testValue) HStack{ TextField("Enter subject", text: $transaction.subject) .onAppear(perform: { UITextField.appearance().clearButtonMode = .whileEditing }) Divider() TextField("Select icon", text: $transaction.icon) .keyboardType(.init(rawValue: 124)!) .multilineTextAlignment(.trailing) } } } .onDisappear(){ if transaction.amount == 0 { // modelContext.delete(transaction) } } .onChange(of: selectedItem, loadPhoto) .navigationTitle("Transaction") .navigationBarTitleDisplayMode(.inline) .toolbar{ Button("Cancel", systemImage: "trash"){ modelContext.delete(transaction) dismiss() } } .sheet(isPresented: $showingImagePickerView){ ImagePickerView(isPresented: $showingImagePickerView, image: $image, sourceType: .camera) } .onChange(of: image){ let data = image?.pngData() if !(data?.isEmpty ?? false) { transaction.photo = data } } .onAppear(){ cameraManager.requestPermission() setDefaultVendor() setDefaultCategory() setDefaultGroup() } .sheet(isPresented: $showingAmountEntryView){ AmountEntryView(amount: $transaction.amount) } } } }
2
0
117
5d
Toolbar bottomBar in DocumentGroup App disappears
In my own fairly complex DocumentGroup app, I've been having a problem with bottom bar items appearing briefly when first drawn, and then disappearing. This seems to be caused by the invalidation of one or more views in the hierarchy. In Apple's own WritingApp, which is designed to demonstrate DocumentGroup, adding a bottom bar item to the toolbar demonstrates the problem: This toolbar is on the StoryView: ToolbarItem() { Button("Show Story", systemImage: "book") { isShowingSheet.toggle() } .sheet(isPresented: $isShowingSheet) { StorySheet(story: document.story, isShowingSheet: $isShowingSheet) .presentationSizing(.page) } } // This does not persist ToolbarItem(placement: .bottomBar) { Button("Foo") { } } } My 'Foo' button is new. What happens is that it persists for a few seconds; its disappearance coincides with the writing of the file to disk, it seems. I would dearly like it to persist! I've tried adding an ID, setting the toolbar visibility and so on, but no luck. Anyone had this working?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
107
5d
Should setting a UIVisualEffectView's effect to nil remove its visual glass effect?
In the WWDC 2025 session "Build a UIKit app with the with the new design", at the 23:22 mark, the presenter says: And finally, when you no longer need the glass on screen animate it out by setting the effect to nil. The video shows a UIVisualEffectView whose effect is set to a UIGlassEffect animating away as its effect is set to nil. But when I do this in my app (or a sample app), setting effect to nil does not remove the glass appearance. Is this expected? Is the video out of date? Or is this a bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
8
4
94
5d
IOS cursor control
My app controls the cursor movement in a text view on iPhone and iPads. On screen touch, the IOS cursor position is out of sync with the app cursor position. Is there a way to find out, on screen touch, where the ios cursor positition is and update the app cursor to the ios cursor position? When they are out of sync, the user has to move the cursor to the startIndex and navigate from there. Frustating! I have looked at many programming books, forums, and internet search with nothing to no avail. Any help will be greatly appreciated. The app names are SummaGramPhonex and SummaGramIPAD11 and SummaGramIPAD13. Thanks. Charlie 3Sep25
0
0
136
5d
iOS 26 Beta 9 dark/light traits behaviour
I want to check if this behaviour is legit in iOS 26 Beta: We have an admittedly stranger setup where a child view controller acts as a TabBar and is a UIHostingController so that we can use SwiftUI for the tab bar items. One of the tab pages has a scrollview whose content (imagine a chat view) might go from a lighter aspect to darker colors and back when scrolling. When we scroll to predominantly dark bubbles, the trait of the tabBar changes to dark mode. The function traitCollectionDidChange() on the UIHostingController is called ! but only for the tabBar controller. I know that in iOS there is some blending going on at the tabBar level when scrolling, but changing just one view + subviews to dark mode, automatically, instead of user triggered? It might be some optimisation if the view is considered opaque? But then I would expect to not change anything visually, if opaque. Is this expected behaviour on iOS 26? And if so, can we disable it? But just this blending/ trait changing, and keep the user triggered trait changes.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
138
6d