Post

Replies

Boosts

Views

Activity

Reply to Genmoji not working
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Mar ’25
Reply to How to use core spotlight ?
How would you know it never gets triggered? You aren't printing anything to the console. Anyway, in my apps I have the WindowGroup set up like this: var body: some Scene { WindowGroup { PhoneView() .environment(modelData) } } And then, in the PhoneView() I have this: var body: some View { ZStack { // Whatever... } .onContinueUserActivity(CSSearchableItemActionType, perform: handleSpotlight) // blah blah blah... } private func handleSpotlight(userActivity: NSUserActivity) { guard let uniqueIdentifier = userActivity.userInfo?[CSSearchableItemActivityIdentifier] as? String else { return } // Handle the activity... }
Mar ’25
Reply to Safari extension doesn't load
Is this an iOS app with a Safari extension, or just a Safari extension? I know that, in an iOS app, you have to build the iOS app so the extension is included, and then build and run the extension. If it's just a Safari extension, then I'm afraid I don't know.
Topic: Safari & Web SubTopic: General Tags:
Mar ’25
Reply to What is best practice for the app's image format & is there a maximun /minimum number of items the app can contains
You might have to rephrase your question, as I'm not entirely sure what you're asking. If you want to know about app icons you can get all the required info here: https://developer.apple.com/design/human-interface-guidelines/app-icons If you're talking about images in general, you can use anything as long as the code can read it, but I stick with PNG and JPG formats. As for there being a minimum number of 'items', do you mean images? Why does it matter? The minimum would be zero, and the maximum would whatever memory your app uses and file sizes. It's not really an easily-answerable question. Perhaps, if you refine your question you might get a better, more relevant answer.
Topic: Design SubTopic: General
Mar ’25
Reply to 5 day project 😏😏
Sorry, why are you posting this here? These forums are for developers who need help with their code. If you have an issue with your code, provide that code, and ask us for help. If you're just showing off a project, then it's lovely that you're coding, but it's also not appropriate for these forums.
Mar ’25
Reply to json array shows in debugger but can't parse (corrected question)
That's because your JSON is an array. Look: [ <--- BEGIN ARRAY { "id": "8e8tcssu4u2hn7a71tkveahjhn8xghqcfkwf1bzvtrw5nu0b89w", "name": "Test name 0", "country": "Test country 0", "type": "Test type 0", "situation": "Test situation 0", "timestamp": "1546848000" }, { "id": "z69718a1a5z2y5czkwrhr1u37h7h768v05qr3pf1h4r4yrt5a68", "name": "Test name 1", "country": "Test country 1", "type": "Test type 1", "situation": "Test situation 1", "timestamp": "1741351615" }, { "id": "fh974sv586nhyysbhg5nak444968h7hgcgh6yw0usbvcz9b0h69", "name": "Test name 2", "country": "Test country 2", "type": "Test type 2", "situation": "Test situation 2", "timestamp": "1741351603" }, { "id": "347272052385993", "name": "Test name 3", "country": "Test country 3", "type": "Test type 3", "situation": "Test situation 3", "timestamp": "1741351557" } ] <--- END ARRAY You should use something like this: struct NewsFeed: Codable { let id, name, country, type: String let situation, timestamp: String } typealias TheFeed = [NewsFeed] Or, you could consider how I do this in my own app: { "balance": { "current": 342.15, "saver": 1813.32 }, "date": "202503", "data": [ { "date": "20250313", "items": [ { "address": "1 High Street", "time": "13:52", "cost": 6.25 } ] }, { "date": "20250305", "items": [ { "address": "10 The Avenue", "time": "13:19", "cost": 6.99 }, { "address": "25 Main Street", "time": "07:21", "cost": 3.75 }, { "address": "50 The Street", "time": "07:16", "cost": 20.8 } ] } ] } That JSON conforms to these structs: struct Month: Codable { let balance: Balance let date: String let data: [LineItem] } struct LineItem: Codable { let date: String let items: [Details] } struct Details: Codable { let address: String? let time: String let cost: Double } struct Balance: Codable { let current: Double let saver: Double } I decode the data into the Month struct because a Month contains a balance of type Balance, a date String and an array of LineItems. Each LineItem contains a date String and an array of Details. Each Details contains an address String optional, a time String, and a cost Double. I don't have a root array; I have a root Month so I have curly braces.
Mar ’25
Reply to Blocking app quit
It is a terrible user experience to stop someone from quitting an app, and you should not do this. Just write your app as though someone who wants to use it is going to leave it running. If I installed your app, launched it, and then couldn't quit it, it would be immediately moved to the trash, and I'd likely never use anything you ever developed in future.
Topic: UI Frameworks SubTopic: General Tags:
Mar ’25
Reply to json array shows in debugger but can't parse
This is one of the items in your JSON data: "id":"8e8tcssu4u2hn7a71tkveahjhn8xghqcfkwf1bzvtrw5nu0b89w", "name":"Test name 0", "country":"Test country 0", "type":"Test type 0", "situation":"Test situation 0", "timestamp":"1546848000" If you're decoding into your NewsFeed struct then the JSON needs to match that struct. Here's your struct: var id: String // Yep, this is fine var name: String // Fine var country: String // Fine var type: String // Fine var overallrecsit: String // What's this? I'm expecting 'situation'... var dlastupd: String // What's this? `timestamp`, maybe? var doverallrecsit: String // No idea How can you expect to decode some JSON into a struct that doesn't match it?
Mar ’25
Reply to Genmoji not working
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to use core spotlight ?
How would you know it never gets triggered? You aren't printing anything to the console. Anyway, in my apps I have the WindowGroup set up like this: var body: some Scene { WindowGroup { PhoneView() .environment(modelData) } } And then, in the PhoneView() I have this: var body: some View { ZStack { // Whatever... } .onContinueUserActivity(CSSearchableItemActionType, perform: handleSpotlight) // blah blah blah... } private func handleSpotlight(userActivity: NSUserActivity) { guard let uniqueIdentifier = userActivity.userInfo?[CSSearchableItemActivityIdentifier] as? String else { return } // Handle the activity... }
Replies
Boosts
Views
Activity
Mar ’25
Reply to Live Captions only partially works - help?
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Changing minimum deployment to iOS 17.0 Xcode compiler issues
We can't really do anything without seeing any code. Generally, I've gotten those warnings if I've done something wrong, but it's not obvious what. Can you post what you changed the onChange from and to?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Mar ’25
Reply to I have not received the email with the TestFlight invitation.
You need to get in touch with the developer of the app you want to use in TestFlight. Firing out a post to us random developers isn't going to work. You're in the wrong place.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Safari extension doesn't load
I can only suggest you raise a bug in the normal way, and hope that Apple's engineers look at it.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Apple watch problem when only play music on watch
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Similar Issues anyone?!
Completely inappropriate for these forums. Also, reads a lot like a bad AI wrote it.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Safari extension doesn't load
Is this an iOS app with a Safari extension, or just a Safari extension? I know that, in an iOS app, you have to build the iOS app so the extension is included, and then build and run the extension. If it's just a Safari extension, then I'm afraid I don't know.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to What is best practice for the app's image format & is there a maximun /minimum number of items the app can contains
You might have to rephrase your question, as I'm not entirely sure what you're asking. If you want to know about app icons you can get all the required info here: https://developer.apple.com/design/human-interface-guidelines/app-icons If you're talking about images in general, you can use anything as long as the code can read it, but I stick with PNG and JPG formats. As for there being a minimum number of 'items', do you mean images? Why does it matter? The minimum would be zero, and the maximum would whatever memory your app uses and file sizes. It's not really an easily-answerable question. Perhaps, if you refine your question you might get a better, more relevant answer.
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Mar ’25
Reply to 5 day project 😏😏
Sorry, why are you posting this here? These forums are for developers who need help with their code. If you have an issue with your code, provide that code, and ask us for help. If you're just showing off a project, then it's lovely that you're coding, but it's also not appropriate for these forums.
Replies
Boosts
Views
Activity
Mar ’25
Reply to json array shows in debugger but can't parse (corrected question)
That's because your JSON is an array. Look: [ <--- BEGIN ARRAY { "id": "8e8tcssu4u2hn7a71tkveahjhn8xghqcfkwf1bzvtrw5nu0b89w", "name": "Test name 0", "country": "Test country 0", "type": "Test type 0", "situation": "Test situation 0", "timestamp": "1546848000" }, { "id": "z69718a1a5z2y5czkwrhr1u37h7h768v05qr3pf1h4r4yrt5a68", "name": "Test name 1", "country": "Test country 1", "type": "Test type 1", "situation": "Test situation 1", "timestamp": "1741351615" }, { "id": "fh974sv586nhyysbhg5nak444968h7hgcgh6yw0usbvcz9b0h69", "name": "Test name 2", "country": "Test country 2", "type": "Test type 2", "situation": "Test situation 2", "timestamp": "1741351603" }, { "id": "347272052385993", "name": "Test name 3", "country": "Test country 3", "type": "Test type 3", "situation": "Test situation 3", "timestamp": "1741351557" } ] <--- END ARRAY You should use something like this: struct NewsFeed: Codable { let id, name, country, type: String let situation, timestamp: String } typealias TheFeed = [NewsFeed] Or, you could consider how I do this in my own app: { "balance": { "current": 342.15, "saver": 1813.32 }, "date": "202503", "data": [ { "date": "20250313", "items": [ { "address": "1 High Street", "time": "13:52", "cost": 6.25 } ] }, { "date": "20250305", "items": [ { "address": "10 The Avenue", "time": "13:19", "cost": 6.99 }, { "address": "25 Main Street", "time": "07:21", "cost": 3.75 }, { "address": "50 The Street", "time": "07:16", "cost": 20.8 } ] } ] } That JSON conforms to these structs: struct Month: Codable { let balance: Balance let date: String let data: [LineItem] } struct LineItem: Codable { let date: String let items: [Details] } struct Details: Codable { let address: String? let time: String let cost: Double } struct Balance: Codable { let current: Double let saver: Double } I decode the data into the Month struct because a Month contains a balance of type Balance, a date String and an array of LineItems. Each LineItem contains a date String and an array of Details. Each Details contains an address String optional, a time String, and a cost Double. I don't have a root array; I have a root Month so I have curly braces.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Problem with ads.txt file
Speak to the admob people?
Replies
Boosts
Views
Activity
Mar ’25
Reply to Blocking app quit
It is a terrible user experience to stop someone from quitting an app, and you should not do this. Just write your app as though someone who wants to use it is going to leave it running. If I installed your app, launched it, and then couldn't quit it, it would be immediately moved to the trash, and I'd likely never use anything you ever developed in future.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to json array shows in debugger but can't parse
This is one of the items in your JSON data: "id":"8e8tcssu4u2hn7a71tkveahjhn8xghqcfkwf1bzvtrw5nu0b89w", "name":"Test name 0", "country":"Test country 0", "type":"Test type 0", "situation":"Test situation 0", "timestamp":"1546848000" If you're decoding into your NewsFeed struct then the JSON needs to match that struct. Here's your struct: var id: String // Yep, this is fine var name: String // Fine var country: String // Fine var type: String // Fine var overallrecsit: String // What's this? I'm expecting 'situation'... var dlastupd: String // What's this? `timestamp`, maybe? var doverallrecsit: String // No idea How can you expect to decode some JSON into a struct that doesn't match it?
Replies
Boosts
Views
Activity
Mar ’25