Post

Replies

Boosts

Views

Activity

Reply to How to control when a DatePicker "pops up"
The result of tapping the "unscheduled" button is not to set the date to .now, but to allow the user to schedule the activity, presumably sometime in the future But that would involve more than one tap anyway, wouldn't it? My example of .now was just an example so that the DatePicker would be displayed with a valid date, and not the year 4000 as you required. You could choose to craft a date for one week today at noon instead. If you want a cleaner UI then you should maybe do as I suggested and have the DatePicker disabled if it's unscheduled, and have a toggle that enables the picker? import SwiftUI struct ContentView: View { @State private var scheduled: Bool = false @State private var date: Date = .now.advanced(by: 24 * 7 * 60 * 60) var body: some View { VStack { Toggle("Scheduled", isOn: $scheduled) .padding(.horizontal) Group { HStack { DatePicker("Date", selection: $date) .disabled(!scheduled) .opacity(scheduled ? 1 : 0.4) } .padding() } .border(.black.opacity(scheduled ? 1 : 0.2), width: 2) .padding(.horizontal) } } } #Preview { ContentView() } Unscheduled: Scheduled: Or the HStack in the middle (lines 13-15) could be changed to this so you only ever see a date when the toggle is on: if(scheduled) { DatePicker("Date", selection: $date) .disabled(!scheduled) .opacity(scheduled ? 1 : 0.4) } else { Text("Toggle switch to schedule") .frame(maxWidth: .infinity) .opacity(scheduled ? 1 : 0.4) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to Need guidance for creating the xcprivacy file WITHOUT A MAC when coding on flutter, especially when third party sdks are there.
I don't think it matters whether you're using any SDKs, does it? When I create a new privacy file in Xcode I'm not asked to select SDKs. All I'm asked is what to call it, where to save the file, and which app targets it applies to. That said, it's just a property list XML file. Here's a simple example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSPrivacyAccessedAPITypes</key> <array> <dict> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryUserDefaults</string> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>1C8F.1</string> </array> </dict> </array> </dict> </plist> Be sure to choose the correct values from here: https://developer.apple.com/documentation/bundleresources/privacy-manifest-files
Mar ’25
Reply to I sent Proposal for Apple Silicon.app
The Feedback Assistant is for everyone to send Apple feedback, issues, bug reports, and suggestions. Your suggestion was correctly sent to Apple via the Feedback Assistant. If they have any questions about your feedback, they will be in touch with you. These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. As such, this isn't the right place to ask for feedback on your suggestion. Thank you.
Topic: App & System Services SubTopic: Hardware Tags:
Mar ’25
Reply to How to control when a DatePicker "pops up"
Can you not simply change the date so that the DatePicker appears? import SwiftUI struct ContentView: View { @State private var date: Date = .distantFuture var body: some View { HStack { if(date == .distantFuture) { Text("Date") Button("unscheduled") { date = .now // <<-- This is the important bit } .buttonStyle(.bordered) } else { DatePicker("Date", selection: $date) } } .padding() } } #Preview { ContentView() } The only thing with this is that the button can never be re-displayed, i.e. once you click it to change date to .now you cannot change it back to .distantFuture. If you need to do that, you'll have to add some extra UI for that to happen. If I needed to do that, I'd actually put this control in its own section, and have a check box showing it's scheduled when checked (and the DatePicker is then enabled), and unscheduled when not checked (no DatePicker, maybe just some text saying it's unscheduled).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to Feature duration
Wrong place for feature suggestions. These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. These forums are not where Apple's actual developers chat about new features. If you have a suggestion, you should raise it at: https://www.apple.com/feedback/
Topic: Community SubTopic: Apple Developers Tags:
Mar ’25
Reply to scenePhase not behaving as expected on screen lock
Coupe of things here. I'll assume you've set scenePhase using: @Environment(\.scenePhase) private var scenePhase If so, you don't need phase in; you can simply refer to scenePhase, i.e.: .onChange(of: scenePhase) { if(scenePhase == .active) { Secondly, scenePhase does not equal UIApplication.shared.applicationState. An application can be active and a scene can be inactive. That's why you're seeing your debug output. The app goes into the background after a few seconds, to allow you to complete any processing you needed to do - writing to a file, or database, whatever. The scene will go into the background before the app. Do you really need to know if the app state has changed, or the scene? It seems you're mixing two things here.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to .onAppear and .task code not running
Where is view6 in your switch statement? Where is view defined? I'd rename it to something else: "view" is too generic, and could be mistyped to "View". Do View1() through View5() actually display anything? Secondly, it's .onAppear {} not .onAppear() {}.
Topic: Design SubTopic: General Tags:
Mar ’25
Reply to Video preview
Is this an iOS app? If so, perhaps your video settings are wrong in your iOS Settings app? If so, re-record it. Or you can use something like ffmpeg or Handbrake to re-encode the existing file.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Detached Keychain Suggestion Transparent UI when Programmatically Focusing NSSecureTextField (AppKit/Objective-C)
You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums. You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to control when a DatePicker "pops up"
The result of tapping the "unscheduled" button is not to set the date to .now, but to allow the user to schedule the activity, presumably sometime in the future But that would involve more than one tap anyway, wouldn't it? My example of .now was just an example so that the DatePicker would be displayed with a valid date, and not the year 4000 as you required. You could choose to craft a date for one week today at noon instead. If you want a cleaner UI then you should maybe do as I suggested and have the DatePicker disabled if it's unscheduled, and have a toggle that enables the picker? import SwiftUI struct ContentView: View { @State private var scheduled: Bool = false @State private var date: Date = .now.advanced(by: 24 * 7 * 60 * 60) var body: some View { VStack { Toggle("Scheduled", isOn: $scheduled) .padding(.horizontal) Group { HStack { DatePicker("Date", selection: $date) .disabled(!scheduled) .opacity(scheduled ? 1 : 0.4) } .padding() } .border(.black.opacity(scheduled ? 1 : 0.2), width: 2) .padding(.horizontal) } } } #Preview { ContentView() } Unscheduled: Scheduled: Or the HStack in the middle (lines 13-15) could be changed to this so you only ever see a date when the toggle is on: if(scheduled) { DatePicker("Date", selection: $date) .disabled(!scheduled) .opacity(scheduled ? 1 : 0.4) } else { Text("Toggle switch to schedule") .frame(maxWidth: .infinity) .opacity(scheduled ? 1 : 0.4) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Video preview
What's your frame rate? Have you tried reducing it?
Replies
Boosts
Views
Activity
Mar ’25
Reply to Need guidance for creating the xcprivacy file WITHOUT A MAC when coding on flutter, especially when third party sdks are there.
I don't think it matters whether you're using any SDKs, does it? When I create a new privacy file in Xcode I'm not asked to select SDKs. All I'm asked is what to call it, where to save the file, and which app targets it applies to. That said, it's just a property list XML file. Here's a simple example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSPrivacyAccessedAPITypes</key> <array> <dict> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryUserDefaults</string> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>1C8F.1</string> </array> </dict> </array> </dict> </plist> Be sure to choose the correct values from here: https://developer.apple.com/documentation/bundleresources/privacy-manifest-files
Replies
Boosts
Views
Activity
Mar ’25
Reply to I sent Proposal for Apple Silicon.app
The Feedback Assistant is for everyone to send Apple feedback, issues, bug reports, and suggestions. Your suggestion was correctly sent to Apple via the Feedback Assistant. If they have any questions about your feedback, they will be in touch with you. These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. As such, this isn't the right place to ask for feedback on your suggestion. Thank you.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to control when a DatePicker "pops up"
Can you not simply change the date so that the DatePicker appears? import SwiftUI struct ContentView: View { @State private var date: Date = .distantFuture var body: some View { HStack { if(date == .distantFuture) { Text("Date") Button("unscheduled") { date = .now // <<-- This is the important bit } .buttonStyle(.bordered) } else { DatePicker("Date", selection: $date) } } .padding() } } #Preview { ContentView() } The only thing with this is that the button can never be re-displayed, i.e. once you click it to change date to .now you cannot change it back to .distantFuture. If you need to do that, you'll have to add some extra UI for that to happen. If I needed to do that, I'd actually put this control in its own section, and have a check box showing it's scheduled when checked (and the DatePicker is then enabled), and unscheduled when not checked (no DatePicker, maybe just some text saying it's unscheduled).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Why does Array.contains cause a compile-time error when comparing an optional value with a non-optional value in Swift?
Answered in your duplicate post. (Please don't raise duplicate posts.)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Feature duration
Wrong place for feature suggestions. These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. These forums are not where Apple's actual developers chat about new features. If you have a suggestion, you should raise it at: https://www.apple.com/feedback/
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to scenePhase not behaving as expected on screen lock
Coupe of things here. I'll assume you've set scenePhase using: @Environment(\.scenePhase) private var scenePhase If so, you don't need phase in; you can simply refer to scenePhase, i.e.: .onChange(of: scenePhase) { if(scenePhase == .active) { Secondly, scenePhase does not equal UIApplication.shared.applicationState. An application can be active and a scene can be inactive. That's why you're seeing your debug output. The app goes into the background after a few seconds, to allow you to complete any processing you needed to do - writing to a file, or database, whatever. The scene will go into the background before the app. Do you really need to know if the app state has changed, or the scene? It seems you're mixing two things here.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to .onAppear and .task code not running
Where is view6 in your switch statement? Where is view defined? I'd rename it to something else: "view" is too generic, and could be mistyped to "View". Do View1() through View5() actually display anything? Secondly, it's .onAppear {} not .onAppear() {}.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Tax forms help for Indian companies
What parts of the forms are you having an issue with? Have you searched the internet for info on how to complete the forms? Here's the IRS themselves telling you how to complete the W-8BEN-E: https://www.irs.gov/pub/irs-pdf/iw8bene.pdf
Replies
Boosts
Views
Activity
Mar ’25
Reply to Finance Report 404 for Arcade game
Are you having one issue with the report or three, 'cos you created three very similar posts at the same time? There's no need to create duplicate posts. Just edit your original post. You can do so within an hour of originally posting it. If you're outside that 1-hour window, just reply to your own original post. Please don't clutter these forums.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Notarization of Electron MacOS App taking too long
Zero reason to post a second post with minor changes.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Developer Mode Restart without HomeButton
Anything available in the Accessibility settings?
Replies
Boosts
Views
Activity
Mar ’25