Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

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

We can’t see Large Title on NavigationBar on iOS 26
Apps built with the iOS 26 beta SDK do not display largeTitle. When we built with iOS 18 SDK, it displayed correctly. The official reference shows that a property named largeTitle has been added since iOS 26 beta. However, setting this did not change the result. Does anyone know how to implement the property?
Topic: UI Frameworks SubTopic: UIKit
4
0
69
1h
Keyboard fails to appear after converting app to UIScene lifecycle
Getting this in log any time I try to start typing anything into a UITextField: First responder issue detected: non-key window attempting reload - allowing due to manual keyboard (first responder window is <UIWindow: 0x10e016880; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x10ba53850>; backgroundColor = <UIDynamicProviderColor: 0x108563370; provider = <NSMallocBlock: 0x11755bd50>>; layer = <UIWindowLayer: 0x10ba84190>>, key window is ) I'm suspicious of the empty "key window is" field. Everything else in the app is working fine. But I cannot figure out why this fails to show the keyboard, and no keyboard notifications are being received by the app. What could it be?
1
0
27
2h
Error querying optional Codable with SwiftData
I'm building a SwiftUI app using SwiftData. In my app I have a Customer model with an optional codable structure Contact. Below is a simplified version of my model: @Model class Customer { var name: String = "" var contact: Contact? init(name: String, contact: Contact? = nil) { self.name = name self.contact = contact } struct Contact: Codable, Equatable { var phone: String var email: String var allowSMS: Bool } } I'm trying to query all the Customers that have a contact with @Query. For example: @Query(filter: #Predicate<Customer> { customer in customer.contact != nil }) var customers: [Customer] However no matter how I set the predicate I always get an error: BugDemo crashed due to an uncaught exception NSInvalidArgumentException. Reason: keypath contact not found in entity Customer. How can I fix this so that I'm able to filter by contact not nil in my Model?
0
0
13
3h
View shown by App Intent with ShowsSnippetView doesn't adapt to dark mode
I have an App Intent that conforms to ShowsSnippetView and returns a view that is shown in the Siri interface after the shortcut runs. The view simply consists of a VStack with a Text element, with no special styling. When my device is set to dark mode, the view doesn't adapt: the text is black, but the background of the Siri interface is a transparent dark gray, which makes the text almost unreadable. The text should be white in dark mode. The colorScheme environment value inside the view corresponds to light mode, even though the device is set to dark mode. This is most likely a bug in iOS.
10
0
93
4h
Failed to open URL asynchronously
I have a problem with the URL schemes under iOS 18. Data is being sent from one app to another app. The amount of data varies. It can sometimes be more than 5 MB. With iOS 18, errors often occur when sending large amounts of data. The error message is: "Failed to open URL asynchronously". If I send the data once again in this case, it works. To reproduce the error quickly, I wrote two small apps. AppA sends data to AppB. AppB calls AppA and AppA sends data to AppB again. The whole thing runs in an endless loop. Code snippet: // AppA // The file to which fileUrl points contains a 4 MB string. // The string consists of only one letter “AAAAAA....” let dataStr = try String(contentsOf: fileUrl, encoding: .utf8) if let url = URL(string: "appb://receive?data=\(dataStr)") { UIApplication.shared.open(url, options: [:]) { (result) in if !result { os_log("can't open url", type: .error) } } } // AppB DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { if let returnUrl = URL(string: "appa://return") { UIApplication.shared.open(returnUrl) } } If the test is started, the error occurs approximately 15-20 times per hour. The first error occurs very quickly if the device is restarted prior to this. As soon as the error occurs, we end up in os_log(“can't open url”, type: .error) I know the possibility of exchanging the data via AppGroups, but cannot use it in our case. Tested with following devices: // The error occurs: iPhone 11 with iOS 18.4.1 iPhone SE with iOS 18.5 // The error does not occur iPhone 8 with iOS 16.7.10 iPhone 16 simulator on a M1 MacBook (macOS 15.4.1) Unfortunately, there is no other error message in the "Console" app. Except "Failed to open URL asynchronously". There were no problems at this point between iOS 12 and iOS 17. My question is now, are there new limitations to the URL schemes under iOS 18 or is it a bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
104
5h
How to do full width .sheet() on iOS 26+ with small presentation detents?
For certain contexts, I'd like to still have my .sheet() be full width even when it's at a small height. In iOS 26, the sheet is inset from the edges at small detents and expands to full width at larger detents. For example, I have a view where I have a .sheet() that has a height of about 200pts and it contains a horizontally scrolling picker that extends past the bounds of the screen. I'd like the .sheet to expand all the way to the edge when at these small detents, like it would previous to iOS 26. Is it possible to configure this? This change will break a number of existing designs :( A new ViewModifier such as enum PresentationWidth { case dynamic, fixed } func presentationWidth(_ width: PresentationWidth) -> some View would be very nice.
0
0
15
5h
largeTitleDisplayMode does not work correctly in iOS 26
The following code does not work correctly for apps built with the iOS 26 beta SDK. largeTitleDisplayMode = .always // it doesn’t work ! The same program works as expected when built with the iOS 18 SDK. // iOS 26 beta largeTitleDisplayMode = .never // it works as expected largeTitleDisplayMode = .automatic // it works as expected. largeTitleDisplayMode = .always // it doesn’t work! Works same as .automatic!
Topic: UI Frameworks SubTopic: UIKit
2
0
52
6h
Update Widget Every Minute
Is this not possible? I have a simple text view that shows the time, but it doesn't stay in sync with the time. I've tried to use a timer like I do inside the app, but that didn't work. I tried TimelineView with it set to every minute, and that didn't work. I tried to use the dynamic date using Text(date, style: ) and that didn't work. I looked it up and apparently it's a limitation to WidgetKit, however, I don't understand how the Apple Clock widget can have a moving second hand that updates properly. Do I just need to add a bunch of entries in the TimelineProvider? Right now, it's just the default that gets loaded when you create a Widget extension. func timeline(for configuration: SingleClockIntent, in context: Context) async -> Timeline<SingleClockEntry> { var entries: [SingleClockEntry] = [] // Generate a timeline consisting of five entries an hour apart, starting from the current date. let currentDate = Date() for hourOffset in 0 ..< 5 { let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! let entry = SingleClockEntry(date: entryDate, configuration: configuration) entries.append(entry) } return Timeline(entries: entries, policy: .atEnd) } EDIT: This code below seems to be working. Can someone confirm if it will continue to work, or will it eventually stop updating? func timeline(for configuration: SingleClockIntent, in context: Context) async -> Timeline<SingleClockEntry> { var entries: [SingleClockEntry] = [] let calendar = Calendar.current let current = Date() // Get the next minute let secondEntryDate = calendar.nextDate(after: current, matching: DateComponents(second: 0), matchingPolicy: .strict, direction: .forward)! entries.append(SingleClockEntry(date: current, configuration: configuration)) // Adds current time entries.append(SingleClockEntry(date: secondEntryDate, configuration: configuration)) // Adds next minute after current time // Add an entry every min for the next 30 minutes for offset in 0..<30 { let entryDate = Calendar.current.date(byAdding: .minute, value: offset, to: secondEntryDate)! let entry = SingleClockEntry(date: entryDate, configuration: configuration) entries.append(entry) } return Timeline(entries: entries, policy: .atEnd) }
0
0
24
9h
[iOSAppOnMac] ShareKit: Crashes in SHKItemIsPDF() or -[SHKSaveToFilesSharingService saveFileURL:completion:]
I have a custom document-based iOS app that also runs on macOS. After implementing -activityItemsConfiguration to enable sharing from the context menu, I found that the app crashes on macOS when selecting Share… from the context menu and then selecting Save (i.e. Save to Files under iOS). This problem does not occur on iOS, which behaves correctly. - (id<UIActivityItemsConfigurationReading>)activityItemsConfiguration { NSItemProvider * provider = [[NSItemProvider alloc] initWithContentsOfURL:self.document.presentedItemURL]; UIActivityItemsConfiguration * configuration = [UIActivityItemsConfiguration activityItemsConfigurationWithItemProviders:@[ provider ]]; // XXX crashes with com.apple.share.System.SaveToFiles return configuration; } Additionally, I found that to even reach this crash, the workaround implemented in the NSItemProvider (FBxxx) category of the sample project is needed. Without this, the app will crash much earlier, due to SHKItemIsPDF() erroneously invoking -pathExtension on an NSItemProvider. This appears to be a second bug in Apple’s private ShareKit framework. #import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> @implementation NSItemProvider (FBxxx) // XXX SHKItemIsPDF() invokes -pathExtension on an NSItemProvider (when running under macOS, anyway) -> crash - (NSString *)pathExtension { return self.registeredContentTypes.firstObject.preferredFilenameExtension; } @end Again, this all works fine on iOS (17.5) but crashes when the exact same app build is running on macOS (14.5). I believe these bugs are Apple's. Any idea how to avoid the crash? Is there a way to disable the "Save to Files" option in the sharing popup? I filed FB13819800 with a sample project that demonstrates the crash on macOS. I was going to file a TSI to get this resolved, but I see that DTS is not responding to tech support incidents until after WWDC.
Topic: UI Frameworks SubTopic: UIKit
7
3
554
10h
Unable to apply tinted glass effect to toolbar buttons in iOS 26
I'm trying to apply a tinted glass effect to toolbar buttons in iOS 26, similar to what was shown in the WWDC25 videos, but none of the approaches I've tried produce the translucent tinted glass effect. My code structure: .toolbar { ToolbarItem(placement: .navigationBarTrailing) { TrailingToolbarContent( selectedTab: $selectedTab, showingAddBeneficiary: $showingAddBeneficiary ) } } private struct TrailingToolbarContent: View { @Binding var selectedTab: Int @Binding var showingAddBeneficiary: Bool @EnvironmentObject private var settingsViewModel: SettingsViewModel var body: some View { switch selectedTab { case 1: if #available(iOS 26.0, *) { Button(action: { showingAddBeneficiary = true }) { Image(systemName: "plus") } // What I've tried: // .tint(Color("accentPrimary")) // Only changes icon color // .glassEffect(.regular.tint(Color("accentPrimary"))) // No effect // .buttonStyle(.glass).tint(Color("accentPrimary")) // No tint, but orange background // .buttonStyle(.borderedProminent).tint(Color("accentPrimary")) // Works but seems opaque, not glass } // ... other cases } } } What's the correct way to achieve tinted glass effects on toolbar buttons?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
26
12h
Avoid rotation in a UIViewController with two UIWindow app
Hi, I have an iPhone App with an UIWindowScene and two UIWindow's(mainWindow and alertWindow). In the mainWindow I have the whole app and it is allowed to rotate. The alertWindow is a window to show alert's to the user on the top of the screen and I do not want that the content inside rotate. I thought I may do: override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait } And override var shouldAutorotate: Bool { return false } In the rootviewcontroller of alertWindow but after doing those changes the rootviewcontroller of mainWindow does not rotate until I do any navigation. I have thought to have two UIWindowScene's (one per UIWindow) but as far I know iPhone app only supports one UIWindowScene. So, how can I avoid rotation in the viewcontroller of alertWindow without losing the rotation on rootviewcontroller of mainWindow? My viewcontroller is a UIHostingController, so I tried also to avoid from my SwiftUI view but I did not find any solution neither. Thank you in advance
3
0
93
15h
CIContext sporadically crashes on macOS 15.4/15.5, iOS 18.4/18.5
We have some rather old code that worked for many years, but recently started to crash sporadically here: The crash looks like this: or Our code is called from many threads concurrently, but as said it worked without any issues until recently. I've found the apparently same crash on iOS at this Reddit post: https://www.reddit.com/r/iOSProgramming/comments/1kle4h4/ios_185_doesnt_fix_cicontext_rendering_crash/ Recap: we believe it started on macOS 18.4 and is still on macOS 18.5. But maybe it was already on macOS 18.3. This matches the observation in the Reddit post well. Should we create a feedback with sysdiagnose? Thanks! :)
8
4
178
20h
The new iOS 26 navigation bar is far too high in landscape orientation
There are apps which are designed to be used primarily in landscape orientation. Music apps often fall into this category, like GarageBand. The new iOS 26 navigation bar in landscape mode is MUCH higher than in previous SDKs. I am maintaining and shipping a professional piano tuning app which is designed to be used in landscape orientation and the new higher navigation bar significantly reduces the amount of vertical screen real estate for it, leading to visual problems. These screenshots illustrate the difference in nav bar height between iOS 16 and iOS26 and the result it has on my app: I know that I can completely disable the new UI with the UIDesignRequiresCompatibility Info.plist key. But going forward it would be great to have a solution that does not completely prevent liquid glass UI in my app. I know that landscape orientation iPhone apps are not the main focus of UIKit, but please note that there are valid professional use cases for it.
Topic: UI Frameworks SubTopic: UIKit
3
0
94
22h
Screenshot preventing
I’d like to know if Apple currently supports any public API or entitlement for blocking in-app screenshots on iOS. If no such API exists, what is the officially recommended approach for App Store apps to prevent or react to screenshots of sensitive content in a banking app? I have tried using a hidden UITextField with isSecureTextEntry = true and observing UIApplication.userDidTakeScreenshotNotification, but these methods do not block the initial screenshot. Could you please advise how to block screenshots in my app?
Topic: UI Frameworks SubTopic: UIKit
4
0
43
23h
Slideshow / Gallery / Photos app View
How can I create a view that is like the one in the Photos app where you can select an item and it fills the window, then you can drag / swipe between items in that view? I have a working prototype, and it works for photos. But once I get to a video, the gesture no longer works.
2
0
25
1d
Resolving AppIntent in the app from a widget...
Is anyone familiar with AppIntents and their usage? I have an AppIntent defined in my widget extension. I have the same AppIntent defined in the app marked as ForegroundContinuableIntent. If I add the intent on a SwiftUI button and tap the Button it correctly resolves the app's version of the intent and performs that intent. However, what I really want to do is perform the AppIntent manually as the timeline updates but not more often than every hour (i.e. >= 1 hour). It's easy enough to handle the timing in the timeline. However, I do not know how to resolve the intent such that it calls the app's version of the intent (i.e. the same way that a Button does). If I just call perform it will run the version in the widget extension. The end goal is to minimally / periodically sync with the app. Thanks in advance for any help / advice on this.
Topic: UI Frameworks SubTopic: SwiftUI
3
0
96
1d
ViewThatFits and Text Truncation
I'm using ViewThatFits to handle different screen sizes as well as the orientation of the phone. Essentially, I have a smaller view that should only be used in portrait mode on the phone and a larger view that should be used in every other instance. The issue is that both of those views have a Text view that is bound to a String within a SwiftData model. If the String is too long the ViewThatFits considers that when choosing the appropriate subview. This results in a list of items where most items use one view while one or more may use the other view. It would be great if there was a modifier that could be applied to the Text view that resulted in the ViewThatFits ignoring it when determining the appropriate subview. Until such a modifier is available, has anyone come up with creative ways around this?
1
0
21
1d