Search results for

swiftui

16,633 results found

Post

Replies

Boosts

Views

Activity

SwiftUI inspector inside NavigationStack causes scrolling and transition issues
We’ve encountered an issue while developing with SwiftUI: when using the inspector on iPadOS, if the inspector is placed inside a NavigationStack, and both the view attached to the inspector and the content inside the inspector itself are scrollable, scrolling them to the top may cause abnormal jitter. We suspect this issue might be related to NavigationTitle. However, if we place the inspector outside the NavigationStack, tapping any NavigationLink while the inspector is expanded will cause problems with the View.matchedTransitionSource(id:in:) animation. A reproducible project can be found here: https://github.com/ThreeManager785/Inspetor-Issue We’ve tried many approaches but haven’t been able to resolve it. Is there any way to fix this issue?
1
0
172
Sep ’25
Keep getting an error on macOS when trying to use Passkeys to login
I keep getting the following error when trying to run Passkey sign in on macOS. Told not to present authorization sheet: Error Domain=com.apple.AuthenticationServicesCore.AuthorizationError Code=1 (null) The same piece of code is working as expected on iOS. Some more info: The association file and entitlements are correct and validated as everything is working on iOS. The app is built on SwiftUI and use the same codebase for macOS and iOS Validated that the presentation anchor is also correct on macOS because other SSO login works with the same presentation anchor. Not sure where the problem is. Followed https://developer.apple.com/documentation/authenticationservices/public-private_key_authentication/supporting_passkeys/ to get the integration.
2
0
754
Aug ’23
macOS Document-Based SwiftUI App: “Save” menu item not localized in French
Hi everyone, I’ve run into a strange localization issue with macOS document-based apps in SwiftUI/AppKit. I created a standard document-based macOS app in Xcode (SwiftUI template) and added a French localization to the project. All system-generated menu bar commands (File → New, Close, Print, etc.) are correctly translated into French… except for “Save”, which remains in English. To rule out problems in my own code, I created a fresh, unmodified document-based app project in Xcode, and immediately added French localization without touching any code. Same result: all commands are translated except “Save”. This suggests the issue isn’t specific to my app code, but either the project template, or possibly macOS itself. My environment • Xcode version: 16.4 • macOS version: 15.6.1 Sequoia] • Swift: Swift 6 Questions 1. Has anyone else seen this issue with the “Save” command not being localized? 2. Is this expected behavior (maybe “Save” is handled differently from other menu items)? 3. If it’s a
4
0
145
Sep ’25
Reply to iOS26 UISearchbar and UISearchController cancellation issues
For my case, there is no absolute necessary for cancel button. But, search cancelling when tapping outside of search controller feels broken. In our app, there is some sheets presented during search to add filters. When any action is performed in the screen, that does not overlays Search Controller, search is getting cancelled. In the sample code, the right button does not perform its action on first tap, instead it dismisses the search controller. It would be better If I have better control over when search should cancel. Sample code: import UIKit import SwiftUI class BaseSplitViewController: UISplitViewController { // Window root view controller init() { super.init(style: .tripleColumn) } required init?(coder: NSCoder) { fatalError(init(coder:) has not been implemented) } override func viewDidLoad() { self.viewControllers = [ UIViewController(), ContentViewController(), UIViewController(), ] } } class ContentViewController: UIViewController { lazy var searchResultsController = SearchResultsViewCont
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’25
Reply to iOS 26 SwiftUI WebView printing / access underlying WKWebView
That's currently not supported by WebView and WebPage in SwiftUI. The closest alternative is to export the WebPage as a PDF or image and then use that for printing. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?
Topic: UI Frameworks SubTopic: SwiftUI
Sep ’25
iOS 26 SwiftUI WebView printing / access underlying WKWebView
Using the new iOS 26 SwiftUI WebView, is it possible to print (to a physical printer) like we can with WKWebView with UIPrintInteractionController? The documentation for WebView and WebPage seems to skip over printing entirely. If not, and it uses WKWebView under the hood, is there a way to access to it so we could use UIPrintInteractionController? Thanks!!
Topic: UI Frameworks SubTopic: SwiftUI
1
0
138
Sep ’25
WebPage doesn't seem to update view when changed in SwiftUi
I tried the new WebView api in swiftui and tried to pass webPage for this view to be able to control the navigation of the user by giving him the option to go back or forward using nav buttons but the view doesn't get's updated when the webPage.backForwardList.backList so the buttons remains disabled. code snippet: @available(iOS 26, *) struct LinkWebViewFor26: View { let url: URL @State var webPage = WebPage() @Environment(.dismiss) private var dismiss var body: some View { WebView(webPage) .webViewBackForwardNavigationGestures(.disabled) .task { webPage.load(url) } .toolbar { ToolbarItem(placement: .topBarTrailing) { Button { dismiss() } label: { Image(systemName: checkmark) } .buttonStyle(.glassProminent) } ToolbarItemGroup(placement: .topBarLeading) { BackForwardMenu( list: webPage.backForwardList.backList, label: .init(text: Backward, systemImage: chevron.backward) ) { item in webPage.load(item) } BackForwardMenu( list: webPage.backForwardList.forwardList.reversed(), label: .init(text: Forward,
1
0
138
Sep ’25
Reply to WebPage doesn't seem to update view when changed in SwiftUi
Hi, thanks for trying out the new API! I’m able to reproduce the bug, and it seems related to how WebView interacts with SwiftUI’s observation system. We will need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report. In the meantime, one possible workaround is to observe changes to some other property on WebPage, like .onChange(of: webPage.isLoading) { } for example, which will result in the back-forward list updating as expected.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
SwiftUI Button with Image view label has smaller hit target
[Also submitted as FB20213961] SwiftUI Button with a label: closure containing only an Image view has a smaller tap target than buttons created with a Label or the convenience initializer. The hit area shrinks to the image bounds instead of preserving the standard minimum tappable size. SCREEN RECORDING On a physical device, the difference is obvious—it’s easy to miss the button. Sometimes it even shows the button-tapped bounce animation but doesn’t trigger the action. SYSTEM INFO Xcode Version 26.0 (17A321) macOS 15.6.1 (24G90) iOS 26.0 (23A340) SAMPLE CODE The following snippet shows the difference in hit targets between the convenience initializer, a Label, and an Image (the latter two in a label: closure). // ✅ Hit target is entire button Button(Button 1, systemImage: 1.square.fill) { print(Button 1 tapped) } // ✅ Hit target is entire button Button { print(Button 2 tapped) } label: { Label(Button 2, systemImage: 2.square.fill) } // ❌ Hit target is smaller than button Button { print(Button 3 tappe
1
0
191
Sep ’25
Reply to BUG: Store kit configuration file processing macOS
Here's the code. It works on iOS/iPadOS but not macOS for the same .storekit file??? import SwiftUI import StoreKit public enum License: String, CaseIterable, Identifiable { public var id: String { self.rawValue } case subscriptionLifetimePremium = subscription.lifetime case subscriptionYearlyPremium = subscription.yearly case subscriptionMonthlyPremium = subscription.monthly } struct ContentView: View { var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Button(StoreKit Test) { Task { @MainActor in // Request our offers from the app store let productIDs = License.allCases.map { $0.rawValue } print(productIDs: (productIDs)) let productsOffered = try await Product.products(for: Set(productIDs)) print(productsOffered: (productsOffered)) } } } .padding() } }```
Topic: App & System Services SubTopic: StoreKit Tags:
Sep ’25
Save SwiftData object for model with one to many relationship
First the Model: import Foundation import SwiftData //Model for Earned Value Analysis @Model final class CostReport{ var aCWP: Double //Actual Cost of Work Performed var bCWP: Double //Budgeted Cost of Work Performed var bCWS: Double // Budgeted Cost of Work Scheduled var cumACWP: Double// Cumlative Actual Cost of Work Performed var cumBCWP: Double // Cumlative Budgeted Cost of Work Performed var cumBCWS: Double // Cumlative Budgeted Cost of Work Scheduled var startDateOfPeriod: Date var endDateOfPeriod: Date var contract: Contract? init(aCWP: Double = 0.0, bCWP: Double = 0.0, bCWS: Double = 0.0, cumACWP: Double = 0.0, cumBCWP: Double = 0.0, cumBCWS: Double = 0.0, startDateOfPeriod: Date = .now, endDateOfPeriod: Date = .now, contract: Contract) { self.aCWP = aCWP self.bCWP = bCWP self.bCWS = bCWS self.cumACWP = cumACWP self.cumBCWP = cumBCWP self.cumBCWS = cumBCWS self.startDateOfPeriod = startDateOfPeriod self.endDateOfPeriod = endDateOfPeriod self.contract = contract } } @Model //Model for Contracts final c
4
0
238
Sep ’25
Reply to Save SwiftData object for model with one to many relationship
import SwiftData //Model for Earned Value Analysis The Model @Model final class CostReport{ var aCWP: Double //Actual Cost of Work Performed var bCWP: Double //Budgeted Cost of Work Performed var bCWS: Double // Budgeted Cost of Work Scheduled var cumACWP: Double// Cumlative Actual Cost of Work Performed var cumBCWP: Double // Cumlative Budgeted Cost of Work Performed var cumBCWS: Double // Cumlative Budgeted Cost of Work Scheduled var startDateOfPeriod: Date var endDateOfPeriod: Date var contract: Contract? init(aCWP: Double = 0.0, bCWP: Double = 0.0, bCWS: Double = 0.0, cumACWP: Double = 0.0, cumBCWP: Double = 0.0, cumBCWS: Double = 0.0, startDateOfPeriod: Date = .now, endDateOfPeriod: Date = .now, contract: Contract) { self.aCWP = aCWP self.bCWP = bCWP self.bCWS = bCWS self.cumACWP = cumACWP self.cumBCWP = cumBCWP self.cumBCWS = cumBCWS self.startDateOfPeriod = startDateOfPeriod self.endDateOfPeriod = endDateOfPeriod self.contract = contract } } @Model //Model for Contracts final class Contract{ var costRe
Sep ’25
Issues with Family Control API: App Blocking & Screen Time for Multiple Children
We are developing a parental control application in SwiftUI with features like app blocking and screen time management. We are using the Family Control API along with Apple Family Sharing, allowing parents to add multiple children to the family group. We have followed the apple documentation still we are facing following issues: App Blocking Issue: The family picker does not display each child's name separately or their apps individually. Instead, it shows all children's apps together, making it difficult to block apps for a specific child. Screen Time Data Issue: We receive the total screen time usage for all children combined rather than separate screen time data for each child. Syncing Delay: When a new child is added to the Family Sharing group, we are unsure how long it takes for their apps to sync and appear on the parent’s device.
2
0
424
Sep ’25