Post

Replies

Boosts

Views

Activity

Xcode 15 + iOS 17 adds extra padding to widgets
Xcode 15 and iOS 17 now adds extra padding to widget content, which is inconsistent with iOS 16. Run on iOS 16: Same code run on iOS 17, with extra paddings: struct WidgetView : View { var entry: Provider.Entry var body: some View { LicenseView(entry: entry) .background(Color("WidgetBackground")) .modifier { if #available(iOS 17.0, *) { $0.containerBackground(for: .widget) { Color.white // to highlight the padding on iOS 17 } } else { $0 } } } }
4
6
7.6k
Jul ’23
Xcode 15 beta 1 failed to preview SwiftUI view in watchOS target
Hello! I can't preview the SwiftUI views of watchOS target in Xcode 15 beta 1, when the containing iOS app has a SPM dependency. Reproducing steps: Create a new watchOS app project (with a companion iOS app) in Xcode 15. Both iOS and watchOS ContentView can be previewed at this step. Add a Swift package to the iOS target (the package should be an iOS-specific package, not a watchOS one, for example, https://github.com/siteline/SwiftUI-Introspect) After you add the static library to iOS target, the watchOS preview no longer work anymore. If you check the error message, you can find the Xcode preview attempt to build the iOS package against watchOS SDK.
8
6
4k
Oct ’23
Unable to Launch Tests/UITests in Xcode 16 with iOS 18 Simulator
Hello, I'm unable to run any test cases in Xcode 16 with the iOS 18 simulator. Steps to Reproduce: Create a new iOS project in Xcode 16 using the default iOS app template with the testing option checked. Run any test or UI test case by clicking the "Play" icon in the Test navigator. Xcode gets stuck at the "Testing" state indefinitely. Environment: macOS 15 beta 8 Xcode 16 beta 6 iOS 18 beta 7 simulator
11
6
3.3k
Sep ’25
iOS-App-On-Mac app unable to restore purchases or IAP receipt due to file permission issue
Hello! I found that on the latest macOS 13 Ventura, my iOS app (iOS-App-On-Mac-With-M1/M2-Chip) is not able to restore IAP purchases or refresh receipt anymore. When using SKReceiptRefreshRequest() to refresh the IAP receipt, I got following error. Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={ NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x1330c1840 { Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={ NSUnderlyingError=0x13338ebf0 { Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “receipt” in the folder “StoreKit”." UserInfo={ NSFilePath=/Users/***/Library/Containers/EC7E888F-3388-418A-92C5-9CBDDC4A1846/Data/StoreKit/receipt, NSUnderlyingError=0x13333a790 { Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" } } } } } } It seems that the receipt cannot be refreshed due to a file permission issue. Also, the SKPaymentQueue.default().restoreCompletedTransactions() function does not get the purchases properly (but also does not report an error). This issue only appears in my iOS app on macOS 13 Ventura.
6
1
2.0k
Feb ’23
Swift 5.7 compiler doesn't check API availability of PropertyWrapper
I found that in Xcode 14.2 (Swift 5.7), the compiler is unable to check the API availability of PropertyWrappers. For example, SwiftUI.StateObject was introduced in iOS 14, but when compiling for iOS 13, the compiler doesn't give an error. This leads to runtime dylib errors. struct ContentView: View { class Data: ObservableObject {} @StateObject private var data = Data() // 🤔️ No compiler error when targeting iOS 13 var body: some View { Text("Hello") } } The app will crash on iOS 13. dyld: lazy symbol binding failed: Symbol not found: _$s7SwiftUI11StateObjectV12wrappedValueACyxGxyXA_tcfC However, when we use StateObject in a regular statement, the compiler gives an error as expected. This is the correct behavior. init() { _data = StateObject(wrappedValue: Data()) // 'StateObject' is only available in iOS 14.0 or newer } So, it seems that the availability check for PropertyWrappers is not working.
1
1
757
Feb ’23
Xcode 15 beta 5 + iOS 17 beta 4: AppShortcuts do not show up in Shortcuts app
In Xcode 15 beta 5 + iOS 17 beta 4, the AppShortcuts (or maybe Shortcuts app) is broken. The AppShortcuts defined in AppShortcutsProvider are not shown up in the Shortcuts app any more. Reproduce Code import SwiftUI import AppIntents @main struct LearnShortcutsApp: App { var body: some Scene { WindowGroup { Text("Hello, world!") } } } struct MyAction: AppIntent { static let title: LocalizedStringResource = "My Action" func perform() async throws -> some IntentResult { return .result() } } struct MyAppShortcts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut(intent: MyAction(), phrases: [ "Perform action with \(.applicationName)" ], shortTitle: "Perform My Action", systemImageName: "heart") } }
1
1
754
Jul ’23
NavigationStack on iOS 17: NavigationStack can't maintain cell selection effect and experiences jumping
When using NavigationStack and NavigationLink, even in very simple situations, the behavior is not normal. When tapping on a NavigationLink, the cell's selected state cannot be maintained. The selection effect is not visible when pushing and popping views. This makes it difficult for users to track their selected content and the current view. At the moment of tapping a NavigationLink, the scroll offset of the List jumps, which affects the experience very much. (Before tapping a cell, as long as the page is not at the top, it can be reproduced 100%)
1
1
1.2k
Jul ’23
Incorrect compact Dynamic Island layout on iOS 17
Hello, I noticed that the layout of compact Dynamic Island on iOS 17 is incorrect. The edge of the circle shape is unable to be aligned with the edge of Dynamic Island. However, the layout in Xcode Preview is just perfect. And this is also the same layout on previous iOS 16: If you try to workaround the issue by adding an offset to the view, it will be cropped by a misaligned circle.
5
5
2.3k
Oct ’23
Interactive Widget: unable to reload timeline from AppIntent
My app features two kinds of widgets, let's call them kind A and kind B. I have both A and B widgets on my Home Screen. When I tap the button on widget A (associated with App Intent), I expect widget B to also reload. However, if you call WidgetCenter.shared.reloadAllTimelines() inside the perform() method of the AppIntent, the timeline of widget B does not reload immediately. This issue only occurs on a physical device and is not consistently reproducible. On a simulator, however, widget B reloads as expected. FB13152293
5
4
1.2k
Feb ’25
Xcode 15.3 AppIntentsSSUTraining warning: missing the definition of locale # variables.1.definitions
Hello! I've noticed that adding localizations for AppShortcuts triggers the following warnings in Xcode 15.3: warning: missing the definition of zh-Hans # variables.1.definitions warning: missing the definition of zh-Hans # variables.2.definitions This occurs with both legacy strings files and String Catalogs. Example project: https://github.com/gongzhang/AppShortcutsLocalizationWarningExample
7
4
2.4k
Aug ’24