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

Created

Layout issues occur when the Picker style is segmented on macOS.
When I run the following code and change "Is On", I get a problem with the layout of the Picker. There is no problem when using Text(), but when using only Image, it works fine on iOS but there is a problem on macOS. Tested on macOS 26.1, Xcode 26.1. import SwiftUI struct ContentView: View { @State var model = Model() var body: some View { Form { Picker("Category", selection: $model.category) { ForEach(Category.allCases) { item in Image(systemName: item.icon) .tag(item) } } .pickerStyle(.segmented) Toggle("Is On", isOn: $model.isOn) } .formStyle(.grouped) } } struct Model { var category: Category = .a var isOn: Bool = false } enum Category: Int, Identifiable, CaseIterable { case a, b, c var id: Int { rawValue } var icon: String { switch self { case .a: return "a.circle.fill" case .b: return "b.circle.fill" case .c: return "c.circle.fill" } } var name: String { switch self { case .a: return "a" case .b: return "b" case .c: return "c" } } } code-block
1
0
53
Nov ’25
Folder icon change in FileProvider mount in Finder
We are creating a Replicated FileProvider based application, where we need to change folder icons for root level folders. I tried below two approaches. This using NSFileProviderDecorations + Custom UTType, this changed the UI as shown: This using Custom UTType, this had no UI change: How can we change the default folder icon, to our custom icon?
3
0
229
Nov ’25
SwiftUI .toolbar(placement: .keyboard) item not exposed to accessibility on iOS 26.1 (affects VoiceOver + XCUITest)
Description On iOS 26.1, a ToolbarItem placed in .keyboard is no longer exposed to the accessibility hierarchy. As a result: VoiceOver cannot focus or activate the toolbar button XCUITest cannot discover the element, making the UI impossible to test TextEditor() .toolbar { ToolbarItem(placement: .keyboard) { Button("Done") { /* action */ } } } This worked correctly on previous iOS versions. The button appears visually but is missing from both VoiceOver navigation and XCUI accessibility queries. Steps to Reproduce Create a new SwiftUI project. Use a simple text field with a keyboard toolbar button. Run on an iOS 26.1 device or simulator. Focus the text field to show the keyboard. Turn on VoiceOver and attempt to navigate to the toolbar button. Run an XCUITest attempting to locate the button
1
0
89
Nov ’25
screenshot issue
I know iPhone Cannot prohibit screenshots, but I have seen someone else's solution, which is to capture a white page instead of the current design page when taking screenshots. I want to use swift implement iPhone The photo generated when taking a screenshot is a white screen, and I don't want my page to be seen by others
Topic: UI Frameworks SubTopic: General
2
0
118
Nov ’25
How Do Commercial Apps Extract Screen Time Data on iOS?
Looking at Brainrot's UI, they display both "Screen Time: 6h 31m" and a calculated "Health: 91/100" score with a "Tap to Fix" button. This suggests manual sync or a workaround. Specific Questions: Can DeviceActivityReport extensions communicate data back to the main app? (CloudKit, Notifications, Shared files?) Can extensions write to UserDefaults on physical devices? Do commercial apps rely on manual user sync? Is there an alternative API I'm overlooking? Do threshold-based approximations work reliably for daily tracking? I can extract exact minutes in the extension but can't export them to the main app due to sandbox restrictions. Either a technical solution or confirmation that manual sync is the industry standard would help greatly.
1
0
64
Nov ’25
TabView + NavigationStacks broken on iOS 26.1
Broken TabView + NavigationStacks functionality on iOS 26.1. Even the most basic navigation made impossible. Example: TabView { Tab(...) { NavigationStack(path: $homePath) { HomeView() .navigationDestination { ... } } } Tab(...) { NavigationStack(path: $settingsPath) { SettingsView() .navigationDestination { ... } } } } Anything passed to settingsPath is just ignored and would never appear onscreen. (26.0 and prior versions work as expected.) Are there any workarounds?
1
1
119
Nov ’25
MainMenu issue if I start a new Xcode Objective-C Cocoa Mac Storyboard/XIB application.
I'm reading a bit outdated book about Cocoa/Objective-C applications development and I'm trying to code some examples. And so I ended up with an almost empty NSDocument-based app with runtime errors like that: Internal inconsistency in menus - menu <NSMenu: 0xbc726d040> Title: Window Supermenu: 0xbc726d080 (Main Menu), autoenable: YES Previous menu: 0x0 (None) Next menu: 0x0 (None) Items: ( "<NSMenuItem: 0xbc6fcd9a0 Minimize, ke='Command-M'>", "<NSMenuItem: 0xbc6fcda40 Zoom, ke mask=''>", "<NSMenuItem: 0xbc6fcdae0, separator, ke mask=''>", "<NSMenuItem: 0xbc6fcd900 Bring All to Front, ke mask=''>" ) believes it has <NSMenu: 0xbc726d080> Title: Main Menu 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 It looks like as if the menu tries to include itself as a submenu. Am I right? I have no ideas what led to this. If I'm not mistaken this has started since macOS Tahoe. The code that is not a boilerplate one I have: // Document.m #import "Document.h" @implementation Document @synthesize text; - (NSString *)windowNibName { return @"SampleDocument"; } - (void)windowControllerDidLoadNib:(NSWindowController *)aController { [super windowControllerDidLoadNib:aController]; if (self.text == nil) { self.text = @""; } self.textField.stringValue = self.text; } - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { self.text = self.textField.stringValue; return [self.text dataUsingEncoding:NSUTF8StringEncoding]; } - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { if ([data length] > 0) { NSString * string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; self.text = string; } else { self.text = @""; } return YES; } + (BOOL)autosavesInPlace { return YES; } @end There are two xib's: MainMenu.xib and Document.xib but I won't include them here. Please advise how to fix this menu issue.
1
0
175
Nov ’25
Request Review alert is unresponsive in iOS 26.1
Try this simple code: import SwiftUI import StoreKit struct ReviewView: View { @Environment(\.requestReview) var requestReview var body: some View { Button("Leave a review") { requestReview() } } } When the Review Alert shows, the "Not Now" button is disabled for some reason!? It was always tappable in all iOS versions that I remember. And there is no way to opt out, unless the user taps on the stars first. Is it a bug or a feature? Thanks for looking into it!
4
1
927
Nov ’25
NavigationStack Back Button obscured in MacOS
A MacOS SwiftUI app using WindowGroup with a NavigationStack results in having the navigation title overlay the back button. Note that this does not occur if a tabbed interface is used. The work around is simply to hide the navigation bar back button and add a tool bar item that is custom back button. I found a fix on this forum, and it was similar to: #if os(macOS) .navigationBarBackButtonHidden(true) .toolbar { ToolbarItem(placement: .navigation) { Button(action: { dismiss() }) { Label("Back", systemImage: "arrow.left.circle") } } } #endif modifying the NavigationLink targets and where the dismiss() function was provided by: @Environment(\.dismiss) private var dismiss Is there any means to sign up for a notification to inform me that this bug has been fixed?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
136
Nov ’25
PKPaymentButtonType.plain renders blank on iOS 26.1 when built with Xcode 26 (snapshot returns transparent image)
Hello Apple Team, I’ve encountered a regression in iOS 26.1 when building my app with Xcode 26 (iOS 26 SDK). The issue affects PKPaymentButtonType.plain, which now renders as fully invisible and produces transparent snapshots, even though the same code worked correctly in previous Xcode/iOS versions. This has a real-world impact because many apps generate static images from PKPaymentButton for payment selection UIs using UIGraphicsImageRenderer, layer.render(in:), or custom snapshot utilities. When using PKPaymentButton(paymentButtonType: .plain, paymentButtonStyle: .black) on iOS 26.1, when built with Xcode 26, the button: Appears blank / invisible Cannot be snapshotted Produces a fully transparent UIImage, even though the CGImage object exists Behaves differently than older SDKs (Xcode 16.x / iOS < 26.1 This regression only appears when compiling with the new SDK. Other button types work fine. Expected Behavior .plain button should render glyphs as documented snapshot generated via UIGraphicsImageRenderer or drawHierarchy(in:) should produce a visible image Behavior should be consistent with older SDKs unless explicitly deprecated in release notes Expected Behavior .plain button should render glyphs as documented Snapshot generated via UIGraphicsImageRenderer or drawHierarchy(in:) should produce a visible image Behavior should be consistent with older SDKs unless explicitly deprecated in release notes Actual Behavior .plain button renders no glyph at all Snapshot image is fully transparent (alpha = 0), even though size and CGImage metadata are correct Only happens when built with Xcode 26 SDK Same build from Xcode 16.x does not reproduce the issue Steps to Reproduce Create a minimal sample project in Xcode 26 Add the following code: let button = PKPaymentButton(paymentButtonType: .plain, paymentButtonStyle: .black) button.frame = CGRect(x: 0, y: 0, width: 180, height: 48) let renderer = UIGraphicsImageRenderer(size: button.bounds.size) let image = renderer.image { _ in button.drawHierarchy(in: button.bounds, afterScreenUpdates: true) } print(image) Run on iOS 26.1 device or simulator Observe that: The button appears visually empty The generated image is fully transparent Environment Xcode: 26.x (iOS 26 SDK) iOS: 26.1 (iPhone 15 Pro tested) Device: Real device Framework: UIKit + PassKit Button type: .plain ONLY Other types: .pay/.buy/.checkout = OK
2
1
174
Nov ’25
Popover Closes Automatically After Updating to iOS 26.1
After updating to iOS 26.1, the popover opened from a menu bar button closes automatically without any user interaction. When debugging, I found that onPop is being triggered on its own. This behavior did not occur in previous versions of iOS, and there have been no code changes on the app side, so I suspect this may be due to a system behavior change or a potential OS bug. main.dart import 'package:flutter/material.dart'; import 'package:popover/popover.dart' as popover; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( backgroundColor: Colors.cyan[100], title: const Text('Popover Example'), actions: const [ Padding( padding: EdgeInsets.only(right: 8.0), child: PopoverButton(), ), ], ), body: const Center(child: PopoverButton(),), ), ); } } class PopoverButton extends StatelessWidget { const PopoverButton({super.key}); @override Widget build(BuildContext context) { return CupertinoButton( padding: EdgeInsets.zero, color: Colors.pink[100], onPressed: () async { final res = await popover.showPopover<bool>( context: context, transitionDuration: const Duration(milliseconds: 30), bodyBuilder: (context) { return SizedBox( height: 100, width: 100, child: const Center( child: Text( 'aaa', style: TextStyle(fontSize: 24, color: Colors.black), ), ), ); }, barrierDismissible: true, direction: popover.PopoverDirection.bottom, arrowHeight: 15, arrowWidth: 30, barrierColor: Colors.black.withValues(alpha: 0), constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width, maxHeight: MediaQuery.of(context).size.height * 2, ), shadow: const [ BoxShadow( color: Colors.black26, spreadRadius: 10, blurRadius: 80, offset: Offset.zero, ), ], ); }, child: const Text('menu'), ); } } pubspec.yaml description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using flutter pub publish. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: sdk: ^3.6.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions # consider running flutter pub upgrade --major-versions. Alternatively, # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run flutter pub outdated. dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 popover: 0.2.6+2 dev_dependencies: flutter_test: sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the analysis_options.yaml file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images # For details regarding adding assets from package dependencies, see # https://flutter.dev/to/asset-from-package # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/to/font-from-package
1
0
136
Nov ’25
Adopt watchface background for complication
On the California watchface (white) there are two complication slots. The upper one is seemingly not a standard slot and limited to a few Apple-owned apps (Calender, Time, …). It adopts the (default white) background of the watchface, so the date is neatly and cleanly displayed on the watchface backdrop. The other lower circular complication makes up for a fat black bubble now on the clean face, which doesn‘t look too pretty (of course depending on the complication…). I would like to create a complication with rather minimalistic content, and it would look great if it could also share the white background and just produce that content on top of it. While the documentation sounds like it would be possible to make the widget background adopt the context colors (which I would understand as using the same background color), for the life of me I can‘t get anything else than black for the circle. Has anyone achieved that? How would I do that? (Image below shows the temperature widget…mine would have way less and smaller content….)
0
0
101
Nov ’25
iOS 26: cells overlap in UICollectionView orthogonal scrolling section after zoom transition
I have a UICollectionView using a UICollectionViewCompositionalLayout with an orthogonally scrolling section. When selecting a cell, I present a modal view controller with a zoom transition. If I scroll quickly in that section after dismissing the presented view controller, the cells briefly overlap. See the attached screenshot. This issue occurs only on iOS 26 and does not occur on iOS 18. Has anyone found a way to mitigate this? Sample project: https://github.com/antiraum/iOS26_UICollectionViewZoomTransitionIssue Feedback FB21022192
1
0
86
Nov ’25
The largeTitle of UINavigationBar disappears after scrolling on iOS 26.1
My project uses the UINavigationController's largeTitle on the latest iOS 26.1, but I found that when I set the backgroundColor, the navigation bar's largeTitle disappeared after switching between normal and large titles. I checked the latest documentation and consulted AI, but I have not found any good solutions. For the demo project, please refer to FB20986869
2
0
168
Nov ’25
proxy.ScrollTo Unitpoint Y Value uses negative tenths for positioning?
I am using a ScrollViewReader, ScrollView, LazyVStack to organize a list of elements I want to be able to scroll to a specific location so i use elementID in the list and a UnitPoint value. But the y value for unitpoint uses -0.1 to represent 100%. Is this intended behavior, a bug, or am i using something incorrectly? I could not find this in the docs and it was only after debugging I found that proxy.scrollTo(id, UnitPoint(x:0, y:-0.1)) is how you scroll to the end of an item or proxy.scrollTo(id, UnitPoint(x:0, y:-0.05)) to scroll to the center. Am I accessing the scrollTo property wrong or is this just how we use it? Also it seems .bottom is broken due to this aswell (as it uses 1 but the actual value that scrolls to the bottom is -0.1). This seems like unintended behvaior as UnitPoints are supposed to be have values of 0-1 Here is a view which reproduces this behavior struct ScrollTestView: View { @State private var scrollToId: String = "" @State private var scrollToAnchorY: String = "0.0" @State private var scrollProxy: ScrollViewProxy? var body: some View { VStack { HStack(spacing: 12) { TextField("Enter ID (1-30)", text: $scrollToId) .frame(width: 120) .padding(8) .background(Color.gray.opacity(0.1)) .cornerRadius(8) TextField("Anchor Y (0-1)", text: $scrollToAnchorY) .frame(width: 120) .padding(8) .background(Color.gray.opacity(0.1)) .cornerRadius(8) Button { guard let targetId = Int(scrollToId), let anchorY = Double(scrollToAnchorY), let proxy = scrollProxy else { return } let anchorPoint = UnitPoint(x: 0.5, y: anchorY) proxy.scrollTo(targetId, anchor: anchorPoint) } label: { Text("Scroll") .font(.subheadline) .padding(.horizontal, 16) .padding(.vertical, 8) .background(Color.blue) .foregroundColor(.white) .cornerRadius(8) } Spacer() } .padding(.horizontal, 16) .padding(.vertical, 8) ScrollViewReader { proxy in ScrollView { LazyVStack { ForEach(1...30, id: \.self) { itemId in VStack { HStack { Text("Item \(itemId)") .font(.title2) .bold() Spacer() } .padding(.vertical, 16) Divider() .background(Color.gray.opacity(0.6)) } .id(itemId) } } .padding() } .onAppear { scrollProxy = proxy } } } } }
0
0
57
Nov ’25
AppKit Logging Internal inconsistency Errors on NSMenu on macOS 26.1
Appkit starting logging these warnings in macOS 26.1 about my app's MainMenu. **Internal inconsistency in menus - menu <NSMenu: 0xb91b2ff80> Title: AppName Supermenu: 0xb91a50b40 (Main Menu), autoenable: YES Previous menu: 0x0 (None) Next menu: 0x0 (None) Items: () believes it has [<NSMenuSubclassHereThisIsTheMenuBarMenuForMyApp:] 0xb91a50b40> Title: Main Menu 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 ** I don't what that means. The supermenu is the menu that represents the menu used for my app's menu bar (as described by NSMenuSubclassHereThisIsTheMenuBarMenuForMyApp Everything seems to work fine but log looks scary. Please don't throw!
Topic: UI Frameworks SubTopic: AppKit Tags:
5
0
466
Nov ’25
NSButton + TtGC6AppKit18_NSCoreHostingViewVS_12AppKitButton - Image Alignment Changed/Broken in Minor macOS 26.1 Update
I just updated to macOS 26.1. I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get). I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols. With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things. Additionally calling -sizeToFit on a button multiple times can cause it to shrink for example: [button sizeToFit]; // <-- At fitting size // Then later [button sizeToFit]; // Now button is shrunk But if the button is already at its fitting size an additional call later shouldn't make it shrink, it should stay the same size. FB20517174 I see I now inherit SwiftUI, not sure if that has anything to do with this but if I wanted to opt in to fragile layout I wouldn't be using Appkit...
1
0
84
Nov ’25
How to check if a sandboxed app already has the access permission to a URL
I want to check whether a sandboxed application already has access permission to a specific URL. Based on my investigation, the following FileManager method seems to be able to determine it: FileManager.default.isReadableFile(atPath: fileURL.path) However, the method name and description don't explicitly mention this use case, so I'm not confident there aren't any oversights. Also, since this method takes a String path rather than a URL, I'd like to know if there's a more modern API available. I want to use this information to decide whether to prompt the user about the Sandbox restriction in my AppKit-based app.
5
0
212
Nov ’25
Modal presentation of SwiftUI view with TextField leads to frozen UI, missing keyboard and memory leak
Hello, I’m trying to present my custom SwiftUI dialog with text field in UIKit with modalPresentationStyle = .overFullScreen, but it leads to the UI being completely frozen once I select the TextField and memory constantly leaking. The minimal reproducible code is: class ModalBugViewController: UIViewController { var hostingController: UIHostingController<Content>! struct Content: View { @State private var text = "" var body: some View { ZStack { Color.black.opacity(0.5).ignoresSafeArea() VStack { TextField("Test", text: $text) .textFieldStyle(.roundedBorder) .padding() } } } } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear hostingController = UIHostingController(rootView: Content()) addChild(hostingController) view.addSubview(hostingController.view) hostingController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) hostingController.didMove(toParent: self) } } And then in UIKit source view: let viewController = ModalBugViewController() viewController.modalPresentationStyle = .overFullScreen present(viewController, animated: true) The bug is reproducible on iOS 18 - 26.1, even on the simulator, although on iOS 26 it's in landscape mode only. Is there some workaround for this issue that doesn't involve rewriting the whole dialog in UIKit?
1
0
123
Nov ’25