With the new multi-windowing design in iPadOS 26, the behavior of openWindow() has changed.
In iPadOS 18, if I called openWindow(), I would go from a full-screen window to two side-by-side windows. That allowed my app to meet the goal of the user; keep some information on the screen while being able to navigate through the app in the other window.
In iPadOS 26 (beta 3), this no longer works. Instead, a new Window opens ON top of the current window. I am looking for some mechanism to help the user see that two windows are now present and then easily move them on the screen (tiled, side-by-side) or whatever else they would prefer.
SwiftUI
RSS for tagProvide views, controls, and layout structures for declaring your app's user interface using SwiftUI.
Posts under SwiftUI tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Is there any way to change the color of default items like Back button or Search?
Even if I apply .tint() to a view these items in the .toolbar are always in primary color.
I'm unable to find the right combination modifiers to get drag and drop to work using the new .draggable(containerItemID:) and dragContainer(for:in:selection:_:) modifiers. The drag is initiated with the item's ID, the item is requested from the .dragContainer modifier, but the drop closure is never triggered.
Minimal repro:
struct Item: Identifiable, Codable, Transferable {
var id = UUID()
var value: String
static var transferRepresentation: some TransferRepresentation {
CodableRepresentation(contentType: .tab)
}
}
struct DragDrop: View {
@State var items: [Item] = [
Item(value: "Hello"),
Item(value: "world"),
Item(value: "something"),
Item(value: "else")
]
var body: some View {
List(items) { item in
HStack {
Text(item.value)
Spacer()
}
.contentShape(Rectangle())
.draggable(containerItemID: item.id)
.dropDestination(for: Item.self) { items, session in
print("Drop: \(items)")
}
}
.dragContainer(for: Item.self) { itemID in
print("Drag: \(itemID)")
return items.filter { itemID == $0.id }
}
}
}
#Preview("Simple") {
DragDrop()
}
My iOS app supports iOS 18, and I’m using an encrypted CoreML model secured with a key generated from Xcode.
Every few months (around every 3 months), the encrypted model fails to load for both me and my users. When I investigate, I find this error:
coreml Fetching decryption key from server failed: noEntryFound("No records found"). Make sure the encryption key was generated with correct team ID
To temporarily fix it, I delete the old key, generate a new one, re-encrypt the model, and submit an app update. This resolves the issue, but only for a while.
This is a terrible experience for users and obviously not a sustainable solution.
I want to understand:
Why is this happening?
Is there a known expiration or invalidation policy for CoreML encryption keys?
How can I prevent this issue permanently?
Any insights or official guidance would be really appreciated.
The bane of my existence has been designing interfaces where the whole view needs to scroll, but a portion is a List and the other portion is static.
I run into this problem time and again so I was hoping someone has a good solution because we all know that embedding a List view inside ScrollView is a no-go within SwiftUI. It simply doesn't work.
So what is a best practice when you need the whole screen to scroll, but a portion is a List? Use a navigation stack instead of a ScrollView? What if it's a child view of a navigation stack already?
PhaseAnimator seems a good fit to play gifs in SwiftUI:
struct ContentView: View {
let frames = [UIImage(named: "frame-1")!, UIImage(named: "frame-2")!]
var body: some View {
PhaseAnimator(frames.indices) { index in
Image(uiImage: frames[index])
}
}
}
The problem is that by default, there's an opacity transition between phases. So I tried using transition(.identity):
Image(uiImage: gif[index])
.transition(.identity)
.id(index)
It doesn't work. It stays frozen on the first frame.
It does work if I set the transition to a small offset value:
Image(uiImage: gif[index])
.transition(.offset(x: 0, y: 0.1))
.id(index)
It does feel a bit hacky, though.
Is this the expected behavior for .transition(.identity), or is it a bug?
I have a More button in my nav bar that contains a Delete action, and when you tap that I want to show a confirmation dialog before performing the deletion. In order words, I have a toolbar containing a toolbar item containing a menu containing a button that when tapped needs to show a confirmation dialog.
In iOS 26, you're supposed to add the confirmationDialog on the view that presents the action sheet so that it can point to the source view or morph out of it if it's liquid glass. But when I do that, the confirmation dialog does not appear. Is that a bug or am I doing something wrong?
struct ContentView: View {
@State private var showingDeleteConfirmation = false
var body: some View {
NavigationStack {
Text("👋, 🌎!")
.toolbar {
ToolbarItem {
Menu {
Button(role: .destructive) {
showingDeleteConfirmation.toggle()
} label: {
Label("Delete", systemImage: "trash")
}
.confirmationDialog("Are you sure?", isPresented: $showingDeleteConfirmation) {
Button(role: .destructive) {
print("Delete it")
} label: {
Text("Delete")
}
Button(role: .cancel, action: {})
}
} label: {
Label("More", systemImage: "ellipsis")
}
}
}
}
}
}
Is there a SwiftUI version of NSControl.allowsExpansionToolTips? That is, showing a tool tip with the full text when (and only when) a text item is truncated?
Or do I need to use a hosting view to get that behavior?
Navigation Title no longer showing for first Tab in iOS/iPadOS 26 (Directives) in my app Starship SE Corps when running is Xcode 26 simulator and on iPad device itself running iPadOS 26 beta.
Launch app
Notice Navigation Title “Directives” is missing from top tab in Sidebar and Floating Tab View (iPad) and TabView (iOS).
Navigate to other tabs and Navigation Titles appear as expected.
Worked fine (as expected) in iOS/iPadOS 18.5, but broken in iOS/iPadOS 26.
Reference Feedback: FB17987650
I'm developing a calculator app and working to ensure a great experience for both VoiceOver and Braille display users.
For expressions like (2+3)×5, I need two different accessibility outputs:
VoiceOver (spoken): A descriptive string like “left paren two plus three right paren times five,” provided via .accessibilityValue. I'm using a custom spellOut function since VoiceOver doesn't announce parentheses—which are kind of important when doing math!
Braille (symbolic): The literal math string (2+3)×5, provided using .accessibilityCustomContent("", ...), with an empty label so it’s not spoken aloud.
The issue: I don’t have access to a Braille display device and Xcode’s Accessibility Inspector doesn’t seem to show the custom content.
Is there any way to confirm that custom Braille content is being set correctly in Simulator or with other tools?
Or…is there a "math mode" in VoiceOver that forces it to announce parentheses?
Any advice or workarounds would be much appreciated!
Thanks,
Uhl
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
External Accessory
iOS
Accessibility
SwiftUI
The Java Swing and AWT MVC model made it easy to develop complex UIs with data interactions that were not described readily in a nested layer that SwiftUI demands. The implicit update model of SwiftUI greatly complicates development of applications that often requires nested components to have to know too much about other components and other structures than their own, because button events and other user interactions cannot readily alter state across layers. A button push on one component then has to be knowledgable about state in other components which have to have that state represented as @State or @Binding etc. and this causes all kinds of wiring to be spread all over the place rather than have a more centralized "state management function" that would be able to look at the world and synchronize the UIs state across changes.
The fact that the compiler get's lost in the weeds when types and signatures don't match in deeper component structures doesn't help because it makes it doubly hard to do refactoring to raise and lower state management within the structure readily, because the compiler just cannot simply tell you that a function or constructor signature is no longer correct.
Again and and again, I reach the point in a new application where I need to make structural changes in components and my data model, and the SwiftUI compiler fails to compile and just reports "I'm lost in the weeds", with no indication of what it was last working on, aside from a particular level in a multi-layered nested UI.
This typically happens when a sub-views construction is not coded correctly because I changed that view and am looking for what broke, by just letting the compiler tell me what is not compatible. This is how refactoring has been done for ages and it's just amazingly frustrating that Apple engineers don't seem to understand nor care about this issue enough to fix it.
Why does this problem persist through version after version of SwiftUI? Is no-one actually using it for anything?
Hello,
I was doing some tasks, and then noticed a small lag/delay when tapping on a Secure field, I tried to investigate it, and noticed this was not my app issue, so I got it into a Playground and the issue is there (Is there in Physical devices, simulator, playground, iPad playground)
So I suppose this can be SwiftUI Issue:
import SwiftUI
struct ContentView: View {
@State var field1: String = ""
@State var field2: String = ""
@State var field3: String = ""
var body: some View {
VStack {
TextField("", text: $field1, prompt: Text("User"))
SecureField("", text: $field2, prompt: Text("pass"))
SecureField("", text: $field3, prompt: Text("uvv"))
}
}
}
So When the focus is set on Field1 TextField, and then you tap the second field, there is a small delay (Even in simulator, there is a small jump trying to show the keyboard, and in an iPad with physical keyboard, the on-screen keyboard is shown).
The console only shows this message:
Cannot show Automatic Strong Passwords for app bundleID: ... due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings
If you change the order of the elements, or some types, this lag disappears. (For example, adding first the SecureField : [SecureField, TextField, SecureField] the Issue disappears.)
(Even tried to add textContentType as password, newPassword and emailAddress without helping any bit.
Is the new Observations API for WebPage not available in Beta 1 as demoed in the WWDC video? I get this error even though Observation is imported.
I've been trying out the new .safeAreaBar modifier for iOS 26, but I cannot seem to notice any difference between that and .safeAreaInset?
The documentation says:
the bar modifier configures the content to support views to automatically extend the edge effect of any scroll view’s the bar adjusts safe area of.
But I can't seem to see that in action.
Hey there,
since SceneView has been marked as „deprecated“ for SwiftUI, I‘m wondering which alternatives should be considered for the following situation:
I have a SwiftUI app (for iOS and iPadOS) where users can view (with rotate, scale, move gestures) 3D models (USDZ) in a scene. The models will be downloaded from web backend and called via local URL paths.
What I tested:
I‘ve tried ARView in .nonAR mode, RealityView, however I didn‘t get the expected response -> User can rotate, scale the 3D models in a virtual space.
ARView in nonAR mode still shows the object like in normal AR mode without camera stream.
I tried to add Gestures to the RealityView on iOS - loading USDZ 3D models worked but the gestures didn’t).
Model3D is only available for visionOS (that would be amazing to have it for iOS)
I also checked QuickLook Preview however it works pretty strange via Filepicker etc, which is not the way how the user should load the 3D models in my app.
Maybe I missed something, I couldn’t find anything which can help me. I‘m pretty much stucked adopting the latest and greatest frameworks/APIs in my App and taking the next steps porting my app to visionOS.
Long story short 😃:
Does someone have an idea what is the alternative to SceneView for USDZ 3D models?
I appreciate your support!!
Thanks in advance!
Hello,
I have a simple example using StateObject and List. When I bind the List(selection:) to a property of the StateObject like this:
List(selection: $viewModel.selectedIndex) { ... }
I noticed that each time I push the view using a NavigationLink, a new instance of the StateObject is created. However, when I pop the view, the deinit of the StateObject is not called.
When is deinit actually expected to be called in this case?
Example code:
import SwiftUI
@main
struct NavigationViewDeinitSampleApp: App {
var body: some Scene {
WindowGroup {
NavigationStack {
ContentView()
}
}
}
}
struct Item: Hashable {
let text: String
}
@MainActor
fileprivate class ContentViewModel: ObservableObject {
@Published var selectedIndex: Int? = nil
init() {
NSLog("ContentViewModel.init")
}
deinit {
NSLog("ContentViewModel.deinit")
}
}
struct ContentView: View {
@StateObject private var model = ContentViewModel()
let items: [Item] = {
return (0...10).map { i in
Item(text: "\(i)")
}
}()
var body: some View {
List(selection: $model.selectedIndex) {
ForEach(items.indices, id: \.self) { idx in
let item = items[idx]
NavigationLink {
ContentView()
} label: {
Text(item.text)
}
}
}
}
}
Interestingly, if I instead use a plain @State variable inside the View:
@State private var selectedIndex: Int?
...
List(selection: $selectedIndex) { ... }
Then the deinit of the StateObject does get called when the view is popped.
Because there's no sign of deinit being triggered in the first pattern, I’m starting to suspect this might be a SwiftUI bug. Has anyone seen this behavior or have more information about it?
Thanks in advance.
Environment:
Xcode: 16.4(16F6)
iOS Simulator: iPhone SE3 iOS16.4(20E247),iPhone SE3 iOS 18.4(22E238)
I'm having some difficulty with a tabview and getting the new search bar to expand from the search icon.
The tabview works so far, it looks fine, tapping on the search opens the view I will be modifying to use the search bar.
snip from my tabview:
var body: some View {
TabView(selection: $selectedTab) {
Tab("Requests", systemImage: "list.bullet", value: .requests) {
OverseerrRequestView(integrationId: integrationId)
}
Tab("Users", systemImage: "person.3", value: .users) {
OverseerrUserView(integrationId: integrationId)
}
Tab("Search", systemImage: "magnifyingglass", value: .search, role: .search) {
NavigationStack {
OverseerrView(integrationId: integrationId)
.searchable(text: $searchString)
}
}
}
.modifier(TabBarMinimizeIfAvailable())
.navigationTitle("Overseerr")
.modifier(NavigationBarInlineIfAvailable())
}
Currently in that view, I have temporarily constructed a search bar that handles the search function (we're searching externally, not just contents in the view)
snip from my view:
.safeAreaInset(edge: .bottom) {
HStack {
Image(systemName: "magnifyingglass")
.foregroundColor(.secondary)
TextField("Search movies, TV or people", text: $query)
.focused($isSearchFieldFocused)
.onSubmit {
Task { await performSearch() }
}
.submitLabel(.search)
.padding(.vertical, 8)
.padding(.horizontal, 4)
if !query.isEmpty {
Button(action: {
query = ""
searchResults = []
Task { await loadTrending() }
}) {
Image(systemName: "xmark.circle.fill")
.foregroundColor(.secondary)
}
}
}
.padding(.horizontal)
.padding(.vertical, 5)
.adaptiveGlass()
.shadow(radius: 8)
.onAppear {
isSearchFieldFocused = false
}
}
Notes: .adaptiveGlass() is a modifier I created to easily apply liquid glass or not depending on OS version, so as not to require the use of #if or #available in the views.
The end goal here:
have the tab view search "tab" open the OverseerrView.swift (Discover) view, activate the animated search bar, and search the input text to the performSearch() function.
I have similar needs on other tab views, and am trying to move away from needing to manually create a search bar, when one should work from the .search role.
Is there an example project with this search in the tab that I can reference? the landmarks sample project sadly did not include one.
In this WWDC talk about liquid glass https://developer.apple.com/videos/play/wwdc2025/219/ they mention that there are two variants of liquid glass, regular and clear.
I don't see any way to try the clear variant using the .glassEffect() APIs, they only expose regular, is there some other way to try the clear variant?
My iphone 11 pro max in ios 26 is not a liquid glass like other