The zoom navigation transition with matchedTransitionSource in tabViewBottomAccessory does not work when a Published var in an ObservableObjector Observable gets changed. Here is an minimal reproducible example with ObservableObject: import SwiftUI import Combine private final class ViewModel: ObservableObject { @Published var isPresented = false } struct ContentView: View { @Namespace private var namespace @StateObject private var viewModel = ViewModel() // @State private var isPresented = false var body: some View { TabView { Button { viewModel.isPresented = true } label: { Text(Start) } .tabItem { Image(systemName: house) Text(Home) } Text(Search) .tabItem { Image(systemName: magnifyingglass) Text(Search) } Text(Profile) .tabItem { Image(systemName: person) Text(Profile) } } .sheet(isPresented: $viewModel.isPresented) { Text(Sheet) .presentationDragIndicator(.visible) .navigationTransition(.zoom(sourceID: tabViewBottomAccessoryTransition, in: namespace)) } .tabViewBottomAccessory { Button { viewMo
Search results for
swiftui
16,582 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
@DTS Engineer I hope you and the SwiftUI team are aware of the severity of this issue and the massive scale of apps it is affecting. I sincerely hope you treat this with a sense of urgency since there has been two dot releases for iOS 26 and this very apparent and visual bug still has not been resolved. Thanks!
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Thanks for the post and thank you for bringing this issue to our attention. Indeed, this is a known problem where SwiftUI control will need to resize a window with a NavigationSplitView generates Invalid view geometry warnings in Xcode. The issue is currently being investigated. If you would like to be notified when the fix is implemented and Xcode ceases to issue these warnings, we recommend filing a bug report. The warning looks something like this: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to.. In the meantime, please be advised that the engineering team is actively addressing the warning issue. If you want to file a bug please post the FB number here for m
Topic:
UI Frameworks
SubTopic:
SwiftUI
As the title says, when I try to add a Toolbar with a Button to my NavigationSplitView I get a warning about satisfying constraints. Here is a minimal reproducible example: import SwiftUI @main struct ViewTestingApp: App { var body: some Scene { WindowGroup { NavigationSplitView { Text(Sidebar) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button { debugPrint(Hello World!) } label: { Label(, systemImage: flame) } } } } content: { Text(Content) } detail: { Text(Detail) } } } } This is the specific warning I get: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( , , , , ) W
Topic:
UI Frameworks
SubTopic:
SwiftUI
It would be really nice if RealityView could be kept in sync for all platforms. ViewAttachmentComponents are a very useful addition and it is a shame that it is only available on VisionOS, and not iOS. Is there an easy way to add simple SwiftUI views to a RealityView in iOS? I know ViewAttachmentComponents are visionOS only, but can we achieve the same functionality by building Entities manually and somehow mapping SwiftUI views onto it? Is there sample code somewhere we could look at? Thanks
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags:
Hi Albert, Thank you for the links. After reviewing both documentation pages, I've implemented a complete test following the specifications, but password autofill is not working. Test Implementation AASA File (accessible at http://localhost:8080/.well-known/apple-app-site-association): { webcredentials: { apps: [ZW962TGA3F.com.test.PasswordAutofillTest] } } ✅ Served with Content-Type: application/json ✅ Verified accessible via curl ✅ Team ID matches Apple Developer account Associated Domains Entitlement: webcredentials:localhost:8080 ✅ Configured in both Debug and Release entitlements ✅ Bundle ID: com.test.PasswordAutofillTest SwiftUI Implementation: TextField(Email, text: $email) .textContentType(.username) SecureField(Password, text: $password) .textContentType(.password) Authentication Flow: App sends POST to http://localhost:8080/login with credentials Server returns 200 OK App displays Login successful Server logs confirm request received and processed Result ❌ No Save Password prompt appears ❌
Topic:
Privacy & Security
SubTopic:
General
Tags:
Hi, On a SwiftUI map I render a mix of MapPolygon and MapPolyline. All overlays must use the same overlay level (.aboveLabels). Goal: Ensure MapPolyline always renders on top of MapPolygon. Issue: I order data so polylines are last and even render in two passes (polygons first, polylines second), all at .aboveLabels. Despite that, after polygons change (items removed/added based on zoom levels), I see polygons visually on top of polylines. It seems MapKit may batch/reorder rendering internally. Questions: Is there a reliable way in SwiftUI Map to enforce z-order within the same overlay level so MapPolyline always appears above MapPolygon? If not, any known workarounds or best practices? (e.g. different composition patterns, using annotations with zIndex, or other techniques compatible with SwiftUI Map) I know you can do this with UIKit, but first looking for a solution compatible with SwiftUI's version of MapKit. Thanks
We are facing a DNS resolution issue with a specific ISP, where our domain name does not resolve correctly using the system DNS. However, the same domain works as expected when a custom DNS resolver is used. On Android, this is straightforward to handle by configuring a custom DNS implementation using OkHttp / Retrofit. I am trying to implement a functionally equivalent solution in native iOS (Swift / SwiftUI). Android Reference (Working Behavior) : val dns = DnsOverHttps.Builder() .client(OkHttpClient()) .url(https://cloudflare-dns.com/dns-query.toHttpUrl()) .bootstrapDnsHosts(InetAddress.getByName(1.1.1.1)) .build() OkHttpClient.Builder() .dns(dns) .build() Attempted iOS Approach I attempted the following approach : Resolve the domain to an IP address programmatically (using DNS over HTTPS) Connect directly to the resolved IP address Set the original domain in the Host HTTP header DNS Resolution via DoH : func resolveDomain(domain: String) async throws -> String { guard let url = URL( string: ht
I'm working on a SwiftUI application that uses a couple different webviews in a tabview to render some mdx and codemirror editor. The editor webview, the one that's much more complicated works as expected. Some errors appear in the console due to what I imagine is a race condition that I'll get around to fixing, but it works as expected. The other webview which just renders a single, local html file to display a dead simple summary absolutely refuses to work. It first appears to work as expected (shows the same 'return type unsupported' error in the console though) on the initial request, but then refuses to process any JS functions for that particular webview. Even the functions themselves are being used between the two webviews, and they work as expected in the other. Even worse, when I copy and paste the generated JS code into the safari dev tools it works as expected, even in the broken webview. I've spent almost 12 hours on this today so far, and have made zero progress. I've tried commenting ou
Hi everyone, I'm currently working on a native macOS app (built with SwiftUI) and I'm trying to implement Password AutoFill functionality so users can use their saved credentials from Keychain or third-party password managers. I've gone through Apple's documentation, WWDC sessions, and sample code, but I've noticed that the resources primarily focus on iOS and web implementations. There's very limited guidance specifically for macOS. I've set up: Associated Domains entitlement with the webcredentials: service The apple-app-site-association file on my server TextField with .textContentType(.username) and SecureField with .textContentType(.password) However, I'm still not seeing the expected AutoFill behavior on macOS like I would on iOS. Has anyone successfully implemented Password AutoFill on a native macOS app? Are there any macOS-specific considerations or additional steps required that differ from iOS? Any guidance, sample code, or pointers to documentation I might have missed would be greatly app
Apple sent this response on 18 November 2025: We believe this issue has been addressed. Please verify this matter is resolved after updating to iOS 26.2 beta 3. iOS 26.2 beta 3 (Build: 23C5044b) Posted Date: November 17, 2025 In my testing, the issue seems resolved indeed! Thank you! It is great and encouraging news for SpriteKit users. The issue FB20808104, where both SpriteKit and RealityKit drop frames under SwiftUI views, still holds. I will continue to look for updates on the Feedback Assistant.
Topic:
Graphics & Games
SubTopic:
SpriteKit
Tags:
I'm using a custom modifier called AutoSheetDetentModifier to automatically size a sheet based on its content. On iOS 26, it works as expected: the content height is measured correctly and the sheet shrinks to match that height. However, on iOS 16, 17 and 18, the same code doesn’t work. The content height is still measured, but the sheet does not reduce its height. Instead, the sheet remains larger and the content appears vertically centered. (Note that content() includes ScrollView) public struct AutoSheetDetentModifier: ViewModifier { @State private var height: CGFloat = 380 // default value to avoid bouncing public func body(content: Content) -> some View { content .modifier(MeasureHeightViewModifier(height: $height)) .presentationDetents([.height(height)]) } } public struct MeasureHeightViewModifier: ViewModifier { @Binding var height: CGFloat public func body(content: Content) -> some View { content .fixedSize(horizontal: false, vertical: true) .background( GeometryReader { geo -> Color in Dispa
In our case we have been pending weeks to fix a problem that was broken with iOS 26.1 but resolved by a SwiftUI modifier with a new parameter available in Xcode 26.2: extension View { func apply(@ViewBuilder _ block: (Self) -> V) -> V { block(self) } } TabView { // Some tabs } .apply { if #unavailable(iOS 26.1) { // Previous approach that stopped working in iOS/iPadOS 26.1 $0.tabViewBottomAccessory() { if viewModel.showAccessoryView { // accessory content } else { EmptyView() } } } else { // When compiled with Xcode 26.2+ for iOS/iPadOS 26.1+ $0.tabViewBottomAccessory(isEnabled: viewModel.showAccessoryView) { // accessory content } } } So we are further frustrated by this longer than typical delay to open submissions to an RC build.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
With iOS 26.1 we started seeing a bug that only appears on iPhone Air. This bug is visible with simulators too. I have tried so many different ways to fix the issue, but Instruments Profiler is pointing at UIKitCore. We load a tab bar, when the user attempts to switch a tab, the app hangs and never recovers. It happens right as the animation of the Glass bubble is in progress. I have tried a UIKit Tab bar, a SwiftUI Tab bar. I tore out AppDelegate and did a direct @main SwiftUI entry for my application. This issue appears with every tab bar instance I try. I attempted to disable LiquidGlass by utilizing this flag UIDesignRequiresCompatibility in my plist, but the flag seems to be ignored by the system. I am not sure what else to try. I have a trace file if that is helpful. What else can I upload? Here is what the code looks like. struct ContentView: View { @State private var selectedTab = 2 var body: some View { TabView(selection: $selectedTab) { Text(Profile) .tabItem { Label(Me, systemImag
SwiftUI sheet with TextField using autocorrectionDisabled() prevents view model deinit after editing
I present a view as a sheet that contains a TextField and a viewModel. The sheet uses .autocorrectionDisabled() on the TextField. If I open the sheet and dismiss it without editing, the viewModel is released as expected. But if I edit the TextField and then dismiss the sheet, the viewModel is not deinitialized (it remains retained). Test Outputs: // # Present 1st time - Correct ✅ TestViewModel - init - 0x0000600000c12ee0 // Dismiss wihtout editing, deinitialized correctly TestViewModel - deinit - 0x0000600000c12ee0 // # Present 2st time - Incorrect ❌ TestViewModel - init - 0x0000600000c006c0 // Edit and dismiss, no deinit here // # Present 3rd time - Incorrect ❌ TestViewModel - init - 0x0000600000c113b0 // Enter text field to edit will deinit previous one TestViewModel - deinit - 0x0000600000c006c0 // Dismiss, no deinit // TestViewModel (0x0000600000c113b0) remains retained ⚠️ Using .autocorrectionDisabled(true) gives the same problem. Removing or commenting out .autocorrectionDisabled() fixes the issue, but
Topic:
UI Frameworks
SubTopic:
SwiftUI