Post

Replies

Boosts

Views

Activity

StoreKit Causing Unrelated SwiftUI View to Freeze
Hello everyone! I've encountered an issue related to SwiftUI and StoreKit. Please take a look at the SwiftUI code snippet below: import SwiftUI struct ContentView: View { var body: some View { NavigationStack { List { NavigationLink { Page1() } label: { Text("Go to Page 1") } } } } } struct Page1: View { @Environment(\.dismiss) private var dismiss @State private var string: String = "" var body: some View { List { NavigationLink { List { Page2(string: $string) .simpleValue(4) } } label: { Text("Tap this button will freeze the app") } } .navigationTitle("Page 1") } } struct Page2: View { @Binding var string: String? init(string: Binding<String>) { self._string = Binding(string) } var body: some View { Text("Page 2") } } extension EnvironmentValues { @Entry var simpleValue: Int = 3 } extension View { func simpleValue(_ value: Int) -> some View { self.environment(\.simpleValue, value) } } This view runs normally until the following symbol is referenced anywhere in the project: import StoreKit extension View { func notEvenUsed() -> some View { self.manageSubscriptionsSheet(isPresented: .constant(false)) } } It seems that once the project links the View.manageSubscriptionsSheet(isPresented:) method, regardless of whether it's actually used, it causes the above SwiftUI view to freeze. Steps to Reproduce: Clone the repository: https://github.com/gongzhang/StrangeFreeze Open it in Xcode 16 and run on iOS 17-18.1 Navigate to the second page and tap the button, causing the app to freeze. Remove manageSubscriptionsSheet(...), then everything will work fine
2
0
196
4w
Unable to download artifacts from Xcode Cloud
I just discovered that I can no longer download any artifacts from Xcode Cloud, whether from newly built workflows or previous ones. When I try to download in Xcode, it crashes immediately. When downloading from App Store Connect, it redirects to an HTML page with the following content. {"message":"You are not authorized to access this teamÒ€ℒs resources."} I've already tried re-logging into my Apple account. Is anyone else experiencing the same issue?
4
3
325
Nov ’24
SFSpeechRecognizer is broken on iOS 18
Hello, I noticed that SFSpeechRecognizer is broken on iOS 18. During a recognition task, it keeps dropping the recognized text on every pause. For example, if you say "how are you fine", it will drop the "how are you" part and only give you "fine" as the result. Say "how are you <pause> fine" // iOS 17 βœ… (perfect final result) How How are How are you How are you. How are you. Fine. // iOS 18 ❌ How How are How are you How are you Fine (the text before the pause is dropped, and fail to recognize the punctuations.) Reproducing the issue: Download the official sample project. Run it on an iOS 18 device or simulator. Say "how are you fine" Only "fine" will be displayed.
4
4
835
Sep ’24
JSONEncoder: How to sort keys using "localizedStandardCompare"? (just like how Xcode 16 serialize a xcstrings file)
Hello, I'd like to ask a very fundamental question about JSONEncoder: how to sort keys in a specific order when encoding a dictionary to JSON text? I know there is an option called JSONEncoder.OutputFormatting.sortedKeys, but it sorts the keys only in lexicographic order. I want to sort the keys using a different comparator, such as String.localizedStandardCompare(_:), which achieves the "Finder-like" order. The reason why I ask this question is because I have a localization tool that works with String Catalog (xcstrings file, which is a JSON), but every time my tool serializes an xcstrings file, it always messes up the keys in lexicographic order (I used JSONEncoder + .sortedKeys). Meanwhile, Xcode 16 always serializes the string keys into the "Finder-like" order. As a result, my tool always generates a huge diff when manipulating the xcstrings even when making only a small modification to it. So I am wondering how Xcode 16 implements the String Catalog tool to serialize the JSON in "Finder-like" order. It would be great if JSONEncoder could do that too. Or, maybe I can use another serialization method to implement this behavior?
4
0
573
Sep ’24
Tab button's ax identifier is missing when using `.sidebarAdaptable` TabViewStyle
Hello, I found that if you apply the new .sidebarAdaptable tab view style, the accessibility identifiers of tab bar buttons are missing. import SwiftUI struct ContentView: View { var body: some View { TabView { Tab("Received", systemImage: "tray.and.arrow.down.fill") { Text("Received") } .accessibilityIdentifier("tab.received") // πŸ‘€ Tab("Sent", systemImage: "tray.and.arrow.up.fill") { Text("Sent") } .accessibilityIdentifier("tab.sent") // πŸ‘€ Tab("Account", systemImage: "person.crop.circle.fill") { Text("Account") } .accessibilityIdentifier("tab.account") // πŸ‘€ } .tabViewStyle(.sidebarAdaptable) // πŸ‘ˆ if remove this, ax identifiers are ok } } #Preview { ContentView() } The identifiers automatically appear after a few seconds. But this behaviour breaks a lot of the UI test cases.
2
0
288
Sep ’24
Unable to scroll the list under View.safeAreaInset()
Hello, Just noticed an issue with the .safeAreaInset() and .safeAreaPadding() modifiers. On iOS 18 beta 8, I'm unable to scroll the list or any other scrollable views within the safe area. This behavior is different compared to iOS 17/16. For example, adding a floating button using the .safeAreaInset() modifier: On iOS 18, the list cannot be scrolled or interacted within the bottom circled area.
2
1
366
Sep ’24
Tapping tab icon causes incorrect navigation title layout in SwiftUI on iOS 18
Hello, I'm so glad that now you can scroll the list to top by tapping the tab bar ion on iOS 18. However, the current implementation on iOS 18 beta 8 has a little layout issue. import SwiftUI struct ContentView: View { var body: some View { TabView { Tab("Home", systemImage: "house") { NavigationStack { List { ForEach(0..<100) { i in Text("\(i)") } } .navigationTitle("Root") } } } } } #Preview { ContentView() } Tap the tab icon: Result:
2
0
362
Sep ’24
Wrong unit in HIG > Components > System Experiences > Widget > watchOS widget dimensions
Hello, I noticed a small mistake in the Human Interface Guidelines (HIG). On the page HIG > Components > System Experiences > Widget > watchOS Widget Dimensions, scroll down to the bottom. In the "watchOS widget dimensions" section, the sizes in the table are in pixels (px), not points (pt) actually. However, the table header indicates the sizes should be in points (pt). Page link: https://developer.apple.com/design/human-interface-guidelines/widgets#watchOS-widget-dimensions For example, the widget size in the Smart Stack on a 49mm watch should be 192x81.5 pt (or 382x163 px), not 382x163 pt. This size can be verified with the information provided here: https://developer.apple.com/documentation/watchos-apps/supporting-multiple-watch-sizes/. https://developer.apple.com/documentation/watchkit/wkinterfacedevice/1620974-screenscale
2
0
536
Aug ’24
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
9
6
1.3k
Aug ’24