Search results for

swiftui

16,582 results found

Post

Replies

Boosts

Views

Activity

Swift Charts - weak scrolling performance
Hello there! I wanted to give a native scrolling mechanism for the Swift Charts Graph a try and experiment a bit if the scenario that we try to achieve might be possible, but it seems that the Swift Charts scrolling performance is very poor. The graph was created as follows: X-axis is created based on a date range, Y-axis is created based on an integer values between moreless 0-320 value. the graph is scrollable horizontally only (x-axis), The time range (x-axis) for the scrolling content was set to one year from now date (so the user can scroll one year into the past as a minimum visible date (.chartXScale). The X-axis shows 3 hours of data per screen width (.chartXVisibleDomain). The data points for the graph are generated once when screen is about to appear so that the Charts engine can use it (no lazy loading implemented yet). The line data points (LineMark views) consist of 2880 data points distributed every 5 minutes which simulates - two days of continuous data stream that we want to present. The rest
4
0
1.2k
3w
How to set the custom DNS with the Network client
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
1
0
174
3w
Reply to SwiftUI: NavigationSplitView + Toolbar + Button = Constraint Warning
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
3w
RealityKit, Attachments - not working
The simplest realityView (content, attachments in ... causes Contextual closure expects 1 argument but 2 were used in closure body. I have checked every example and i cannot understand why i get this error regardless of any content. Note: i have added Attachment(id: test) to the attachment closure and get Attachment not is scope. imported both realityKit and SwiftUI.
2
0
218
3w
Reply to RealityKit, Attachments - not working
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:
3w
Implementing Password AutoFill on macOS — Looking for Guidance
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
2
0
272
3w
Reply to Implementing Password AutoFill on macOS — Looking for Guidance
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:
3w
Skybox for iOS/swiftUI not working
I have tried every combination of suggestions to get a skybox to appear. Using swiftUI, realityKit and iOS. Non immersive environment. Does anyone have code that works to display a skybox. When i use a do/catch loop i get environmentResource not found. I have checked the syntax, ensured the folder is referencing the target, used the same name for the folder as the file, the file is a .hdr (i assume this is supported), i have moved the file folder to the top level - no change.
2
0
482
3w
SwiftUI WebView Error
I'm using SwiftUI WebView and this error happens when app becomes inactive, the webview changes to blank, and will be in this state all along even if reopen a new webview. When I switch back to WKWebview, everything works fine. environment Xcode 26.1(17B55) on macOS 15.7.1 Error acquiring assertion: this is the code, pretty simple, in load() function i just call page.load(). WebView(vm.page) .onAppear { Task { await vm.load() } }
1
0
193
3w
SwiftUI - presentationDetents behaves incorrectly on iOS 16–18 but works correctly on iOS 26
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
2
0
140
3w
Reply to SpriteKit framerate drop on iOS 26.0
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:
3w
Reply to Cannot submit apps with Xcode 26.2 RC
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.
3w