Post

Replies

Boosts

Views

Activity

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 Future iPhone Innovations – Portless & Foldable iPhones
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.
Topic: Design SubTopic: General Tags:
Mar ’25
Reply to imessages glitching
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:
Mar ’25
Reply to Strange behavior when pushing UIViewController
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:
Mar ’25
Reply to Using `@ObservedObject` in a function
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:
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 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
Reply to Future iPhone Innovations – Portless & Foldable iPhones
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.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to imessages glitching
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 Strange behavior when pushing UIViewController
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
Mar ’25
Reply to Using `@ObservedObject` in a function
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
Mar ’25