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.
Post
Replies
Boosts
Views
Activity
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.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
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.
Topic:
Programming Languages
SubTopic:
Swift
Speak to the admob people?
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
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:
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?
Topic:
Programming Languages
SubTopic:
Swift
Have you updated the info on this page in App Store Connect?
And, does your app have the right info in the .xcprivacy file?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Your code isn't formatted correctly. Please try again. Just post a minimum reproducible example so we can see what you want fixed.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Can you show us a minimum reproducible example? Please format your code correctly in your post using the formatting tools.
Also, please add a screenshot so we can see what it is you want to fix. It's a little difficult interpreting what someone wants. A picture says a thousand words, etc.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
This is not the right place for your post.
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 employees chat about their upcoming designs.
Apple will not respond to you, and by posting this publicly you've given up any monetary reward for your ideas.
It's a mystery inside an enigma. They either will or will not accept the evidence, so my advice is to just submit it and see what happens. You can always re-submit different evidence later. They're pretty good about it.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
No. Why do you need to know? Why would any app need to detect whether a user has iMessage enabled? I think you need to explain your "boring" reason.
Topic:
App & System Services
SubTopic:
General
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:
Does this happen when you long press something else? Your code for the currencyWrapper doesn't really affect the vc you're trying to view. You're just using it as the thing that you long press to display the vc.
So... Check if it happens on something else, but in the meantime, you should show us the relevant code for CountryViewController as that's the code that's being executed.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
var abc: Int = 5
// abc is 5. Yay! abc is 5!
var globalData: GlobalData... = ?
// What is globalData going to be? globalData is nothing, null, nada.
Since globalData is 'nothing' you cannot access the currentCourse or nextCourse attributes of that object, because it doesn't have those attributes in it yet.
You need to initialise the variable before you do something with it.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
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.
- Replies
- Boosts
- Views
- Activity
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.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
- Replies
- Boosts
- Views
- Activity
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.
Topic:
Programming Languages
SubTopic:
Swift
- Replies
- Boosts
- Views
- Activity
Speak to the admob people?
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
- Replies
- Boosts
- Views
- Activity
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
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?
Topic:
Programming Languages
SubTopic:
Swift
- Replies
- Boosts
- Views
- Activity
Have you updated the info on this page in App Store Connect?
And, does your app have the right info in the .xcprivacy file?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
- Replies
- Boosts
- Views
- Activity
Your code isn't formatted correctly. Please try again. Just post a minimum reproducible example so we can see what you want fixed.
Topic:
UI Frameworks
SubTopic:
SwiftUI
- Replies
- Boosts
- Views
- Activity
Can you show us a minimum reproducible example? Please format your code correctly in your post using the formatting tools.
Also, please add a screenshot so we can see what it is you want to fix. It's a little difficult interpreting what someone wants. A picture says a thousand words, etc.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
- Replies
- Boosts
- Views
- Activity
This is not the right place for your post.
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 employees chat about their upcoming designs.
Apple will not respond to you, and by posting this publicly you've given up any monetary reward for your ideas.
- Replies
- Boosts
- Views
- Activity
It's a mystery inside an enigma. They either will or will not accept the evidence, so my advice is to just submit it and see what happens. You can always re-submit different evidence later. They're pretty good about it.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
- Replies
- Boosts
- Views
- Activity
No. Why do you need to know? Why would any app need to detect whether a user has iMessage enabled? I think you need to explain your "boring" reason.
Topic:
App & System Services
SubTopic:
General
- Replies
- Boosts
- Views
- Activity
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
Does this happen when you long press something else? Your code for the currencyWrapper doesn't really affect the vc you're trying to view. You're just using it as the thing that you long press to display the vc.
So... Check if it happens on something else, but in the meantime, you should show us the relevant code for CountryViewController as that's the code that's being executed.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
- Replies
- Boosts
- Views
- Activity
var abc: Int = 5
// abc is 5. Yay! abc is 5!
var globalData: GlobalData... = ?
// What is globalData going to be? globalData is nothing, null, nada.
Since globalData is 'nothing' you cannot access the currentCourse or nextCourse attributes of that object, because it doesn't have those attributes in it yet.
You need to initialise the variable before you do something with it.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
- Replies
- Boosts
- Views
- Activity