Post

Replies

Boosts

Views

Activity

Reply to From iOS 16, PhotoKit does not return PHAsset of "Recently Deleted" PHAssetCollection ?
You're right that Recently Deleted is now a locked folder/album, and you can infer from the fact that you do or do not get anything back whether it's locked. There may be some property somewhere but a quick look hasn't yielded anything. So I'd just handle if you get something back (album is not locked) or don't get something back (album is locked).
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to How I make order numbers by swiftui
Order numbers are just another property of an object. If you've got some data structure that has, for example, customerName, orderDate, location, then just add an orderNumber field and populate it with whatever number you need to use. I can't tell you what that number should be; it's up to you to decide. Perhaps it's the row id in your database's orders table?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Unable to install iOS & watchOS app to iPhone, because of intents change
After a million changes, I think I've got it working. The fix appears to be to not have a second intents handler target and not try to share the initial one. The code that would've gone inside the second intent definition (the .intentdefinition file and its handler) should instead go inside the Complications target: In the General tab of the project view: Main iOS App target has no supported intents listed. There is a Supported Intents section for them but it's empty. If I put the WidgetEventIntent in here, it fails validation. Widget target does not have any supported intents because there is no section to add them. WidgetIntentHandler has only the WidgetEventIntent listed. Watch App target has only the ComplicationEventIntent. Complications target does not have any supported intents because there is no section to add them. In target membership: ComplicationsEntry.swift which uses the ComplicationEventIntent is only in Complications. ComplicationEventIntent is in Watch App and Complications. WidgetEntry.swift which uses the WidgetEventIntent is only in Widget. WidgetEventIntent is in the Main iOS App, Widget and WidgetIntentHandler. WidgetIntentHandler.swift is only in WidgetIntentHandler. Since Xcode doesn't seem to like it when you have more than one dynamic intent, regardless of how they're set up or which targets they're in, removing the ComplicationsIntentHandler target and moving its code into the Complications target itself removed the complexity of that extra target. With this setup I can deploy to the iPhone Simulator and the Watch Simulator, and also to a physical iPhone and Watch (Series 8), and it validates for sending to App Store Connect. (Though, when it gets to App Review, I'm sure it will be rejected because it's different there, too.) This really shouldn't have taken so long to figure out, but Xcode provides zero help. As you can see from previous error messages Xcode has given me, it tells you there's a problem and its suggested resolution causes another error that cannot be fixed. At the very least - and the easiest thing for Apple to do here - would be to have a project set up correctly when you choose to create a new project > Watch App with iOS companion app. If this had some sample code in it that had the complications and widgets already present and in the right place, and with the right targets and intents, I could've created a new project and compared it. Right now, creating such a project merely gives you the Watch App and iOS app targets. There's nothing in there for widgets or complications. Maybe when you add a new widget or complications target it should put them in the right place? I've been developing for years with Xcode and this has to be the most frustrating thing I've ever experienced with it.
Nov ’22
Reply to building an application with third party APIs
Apple has no involvement in your app, other than taking a cut of the upfront cost of a user buying your app (if it's not free). Apple will have nothing to do with your APIs. If you get a lot of users, and your app uses third-party APIs that charge you for their use, then you will be the one paying for that API usage, not Apple. Price your app accordingly. Finally, your use of random tags on your post on here is inappropriate. Your question has nothing to do with "Core WLAN" or "App Store Connect" or "Frameworks". Use tags more appropriately so your post is seen by the right people.
Nov ’22
Reply to Publishing changes from within view updates is not allowed, this will cause undefined behavior.
Try this: struct MapUIView: View { @StateObject private var ViewModel = ContentViewModal() var body: some View { ZStack(alignment: .bottom) { AreaMap(region: $ViewModel.region) LocationButton(.currentLocation){ ViewModel.requestUserLocationForOnce() } .foregroundColor(.white) .cornerRadius(8) .padding() } } } struct MapUIView_Previews: PreviewProvider { static var previews: some View { MapUIView() } } struct AreaMap: View { @Binding var region: MKCoordinateRegion var body: some View { let binding = Binding( get: { self.region }, set: { newValue in DispatchQueue.main.async { self.region = newValue } } ) return Map(coordinateRegion: binding, showsUserLocation: true) .ignoresSafeArea() } } final class ContentViewModal: NSObject, ObservableObject, CLLocationManagerDelegate{ @Published var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 40, longitude: 120), span: MKCoordinateSpan(latitudeDelta: 100, longitudeDelta: 100)) let locationManager = CLLocationManager() override init() { super.init() locationManager.delegate = self } func requestUserLocationForOnce() { locationManager.requestLocation() } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let latestLocation = locations.first else { //show error return } self.region = MKCoordinateRegion(center: latestLocation.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)) } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print(error.localizedDescription) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to What devices should I take screenshots for iPhone iPad iOS 14
That's not how the screenshots work. If you go into App Store Connect you'll see something like this: In this case, for this app, the 6.7-inch versions are optional, and the 6.5-inch and 5.5-inch ones are required. So you need to provide up to 10 screenshots for 6.5-inch devices, and up to 10 for 5.5-inch devices. As you can see, if someone were to be using a 6.7-inch iPhone, they are being shown the 6.5-inch screenshots because the 6.7-inch ones will scale down to 6.5 inches without really losing anything. But you can provide 6.7-inch versions if there's something different about that device size (maybe the game board is bigger, or the tab bar fits in an extra button, that sort of thing). You can view all sizes in the Media Manager by clicking on that blue link. It'll show you which sizes are required and which are optional.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22