Post

Replies

Boosts

Views

Activity

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 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 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 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 Different Build Schemes -> Error: -Onone Swift optimization level to use previews
Hello, Paris and DTS. My sample iOS app doesn't crash if I run it with a simulator or an actual device although the preview canvas shows an error for a selective build scheme. So I am afraid that I have nothing to report to you. I have installed the said profile as shown below. It's hard to locate the one that I need to look for since the list has several dozen items. Yet, based on Today's date, I don't find one. So what's next?
Feb ’25
Reply to Guideline 4.3(a) - Design - Spam - automatic rejection
You are not going to get anywhere by seeking advice here when it comes to getting your app rejected. It's true that the reviewers can get wrong occasionally. So do I and get my software titles rejected occasionally with mistakes on my side. If your app is rejected for the spam reason, listen to the reviewer and ask them questions. If you already have a similar app at App Store or Mac App Store, you are likely to be advised to provide it as an add-on feature to an existing title. If you have sold a similar product to one retailer and are trying to sell a similar one to another retailer, you are not going anywhere. I'm sure you are not telling us the whole story. So, again, read what the reviewer has said. It's up to you to listen to the reviewer and make changes to software.
Topic: Design SubTopic: General Tags:
Jan ’25
Reply to Showing SwiftUI Below NSStatusItem When Button is Clicked on Over SwiftUI View
I've gotten the following lines of code working. import SwiftUI @main struct MyStatusApp_App: App { #if os(macOS) @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate #endif @StateObject private var statusBarViewModel = StatusBarViewModel() var body: some Scene { WindowGroup { ContentView() .onDisappear { NSApplication.shared.terminate(self) } .environmentObject(statusBarViewModel) } .defaultSize(width: 640, height: 360) } } #if os(macOS) class AppDelegate: NSObject, NSApplicationDelegate { let fileManager = FileManager.default func applicationDidFinishLaunching(_ notification: Notification) { hideTitleBar() NSApp.setActivationPolicy(.accessory) } func applicationWillFinishLaunching(_ notification: Notification) { NSWindow.allowsAutomaticWindowTabbing = false } } #endif // ContentView.swift // import SwiftUI struct ContentView: View { @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate @EnvironmentObject var statusBarViewModel: StatusBarViewModel var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Button("Click me!") { if let statusItem = statusBarViewModel.statusItem { if let button = statusItem.button { if statusBarViewModel.popover == nil { let popover = NSPopover() statusBarViewModel.popover = popover popover.behavior = .transient popover.animates = false popover.contentViewController = NSHostingController(rootView: NotificationView()) } statusBarViewModel.popover?.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) } } } } .frame(width: 200, height: 100) .onAppear { statusBarViewModel.makeStatusMenu() } } } class StatusBarViewModel: ObservableObject { @Published var statusItem: NSStatusItem! @Published var popover: NSPopover? func makeStatusMenu() { statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) if let button = statusItem.button { if let image = NSImage(named: "statusImage") { button.image = image } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24