Post

Replies

Boosts

Views

Activity

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 Overview of steps to create new app from existing one
I honestly wouldn't copy an existing project. You need to change so many things that it's easier to just start a new project and copy over any code or assets you want to re-use. it's also a great opportunity to re-structure and refactor your project to make it more modern or maintainable. I recently tried to create a new app from an existing one as they shared similar code and structure, but I ended up trashing it because I kept getting errors that files didn't exist, etc.
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
Reply to App Transparency can't publish for review?
Have you updated the info on this page in App Store Connect? And, does your app have the right info in the .xcprivacy file?
Replies
Boosts
Views
Activity
Mar ’25
Reply to SWIFTUI: chartLegend alignment 'Centering' option
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
Mar ’25
Reply to UINavigtionController as a child view leaves an unwanted gap
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
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 is a post office reciept proof of address for PO box?
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.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Detect iMessage
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.
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
Reply to Overview of steps to create new app from existing one
I honestly wouldn't copy an existing project. You need to change so many things that it's easier to just start a new project and copy over any code or assets you want to re-use. it's also a great opportunity to re-structure and refactor your project to make it more modern or maintainable. I recently tried to create a new app from an existing one as they shared similar code and structure, but I ended up trashing it because I kept getting errors that files didn't exist, etc.
Replies
Boosts
Views
Activity
Mar ’25