Post

Replies

Boosts

Views

Activity

Reply to How are we supposed to get Ipad screenshots for our store, without having an Ipad? haha
If your app is supposed to work on an iPad then you need to provide screenshots for the iPad. You can do this by building and running on an iPad Simulator on your Mac. If your app is not going to support the iPad then you need to load your project in Xcode, and remove the platforms it doesn't support. This is done in the General tab of the project view's targets. You know there this is? In the left-hand list of your prject's files, the very top blue item is your project name. Click that, and the right-hand side shows your project and a list of targets. Click the targets one by one and remove the iPad from there. You'll need to rebuild the project and confirm it all works, and submit it to App Store Connect. You shouldn't need to add iPad screenshots then.
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:
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