Post

Replies

Boosts

Views

Activity

Reply to Guideline 4.0 - Design
Your use of SignInWithAppleButton is not clear. AuthenticationServices lets you find out whether or not the user is able to sign in on their device. In other words, it tells you whether the app is being used by the valid owner of the device. AuthenticationServices does not necessarily disclose user's e-mail address. So why are you using it?
Mar ’25
Reply to Background Audio Recording
I don't think there is a workaround. They tell you when you are allowed to use the background mode. https://developer.apple.com/documentation/xcode/configuring-background-execution-modes If you use the background mode for a different purpose, it seems that you violate the Guideline 2.5.4. Also, if you make an audio recording without user's consent, you may violate Guideline 2.5.14.
Mar ’25
Reply to Problems Publishing with User Tracking
I've indicated that I don't use this data for ads, that it's only used for personalization and to understand who saves items. What does that mean? It doesn't sound like a grammatically-correct English sentence. I added the NSUserTrackingUsageDescription property to the info.plist. What does it say?
Topic: Community SubTopic: Apple Developers Tags:
Mar ’25
Reply to Clearing Change Count in FileDocument?
I see. I didn't think about it. Thank you, DTS Engineer. I'll try it later. I tried using undoManager with TextEdit under macOS two days ago. The macOS application consistently crashed when I tried to 'redo' it. If I remember correctly, the exact same lines of code didn't crash under iOS.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Reply to First App Submission — Apple can’t see my In-App Purchase product during review (works in debug, not in TestFlight)
Here’s what’s going on: • In debug mode via Xcode, the product shows up correctly, and everything works as expected. • In TestFlight builds, the product doesn’t show up at all — neither for me nor for Apple. • The IAP is currently marked as “Waiting for Review”, not “Ready to Submit”, and it is linked to the current app version in App Store Connect. Pardon me, but what does the TestFlight version of your app have to do with an issue you are currently having? If they say they can't see an in-app purchase product, ask them for a screenshot or two, which they usually do. There is a section where you need to submit an IAP product for review. Have you done that? I happen to have submitted an application to MAS with an IAP today. And I've done that.
Apr ’25
Reply to Opening a New Document from File URL?
Taking a look at openDocument, it says it can open document at a specific URL, provided that its bookmark is resolved. And it does open a file with security-scoped bookmark. func loadBookmarks() async { for bookmarkItem in bookmarkViewModel.bookmarkItems { // resolving a bookmark if let _ = resolveBookmark(bookmarkData: bookmarkItem.bookmarkData) { do { try await openDocument(at: bookmarkItem.bookmarkURL) } catch { print("\(error.localizedDescription)") } } } } struct BookmarkItem: Codable, Hashable { let bookmarkURL: URL let date: Date let bookmarkData: Data let open: Bool }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25
Reply to onReceive(_:perform:) on Frontmost Window Only?
In reference to this article ( https://nilcoalescing.com/blog/ProvidingTheCurrentDocumentToMenuCommands/ ), you can do it with @FocusedBinding. I don't even know what this @FocusedBinding guy is. It's been around since macOS 11? Ugh... import SwiftUI @main struct FocusedBindingCrazyMamaApp: App { var body: some Scene { DocumentGroup(newDocument: FocusedBindingCrazyMamaDocument()) { file in ContentView(document: file.$document) .focusedSceneValue(\.focusedDocument, file.$document) } .commands { CommandGroup(replacing: .saveItem) { UppercasedText() LowercasedText() } } } } extension FocusedValues { struct DocumentFocusedValues: FocusedValueKey { typealias Value = Binding<FocusedBindingCrazyMamaDocument> } var focusedDocument: Binding<FocusedBindingCrazyMamaDocument>? { get { self[DocumentFocusedValues.self] } set { self[DocumentFocusedValues.self] = newValue } } } struct UppercasedText: View { @FocusedBinding(\.focusedDocument) var focusedDocument var body: some View { Button { guard let text = focusedDocument?.text else { return } focusedDocument?.text = text.uppercased() } label: { Text("Uppercase Text") } .disabled(focusedDocument == nil) .keyboardShortcut("u", modifiers: [.command, .shift]) } } struct LowercasedText: View { @FocusedBinding(\.focusedDocument) var focusedDocument var body: some View { Button { guard let text = focusedDocument?.text else { return } focusedDocument?.text = text.lowercased() } label: { Text("Lowercase Text") } .disabled( focusedDocument == nil ) .keyboardShortcut("l", modifiers: [.command, .shift]) } } // ContentView.swift // import SwiftUI struct ContentView: View { @Binding var document: FocusedBindingCrazyMamaDocument var body: some View { TextEditor(text: $document.text) .foregroundStyle(.white) .font(.system(size: 24)) .scrollContentBackground(.hidden) .background(.black) } } #Preview { ContentView(document: .constant(FocusedBindingCrazyMamaDocument())) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25