Post

Replies

Boosts

Views

Activity

Reply to Can I call setAlternateIconName without user consent?
You should be able to call setAlternateIconName whenever you like. Is it not working in your case? Make sure to check for success via the completion handler, or by catching any error thrown if using the async version. If it succeeds, the system should present an alert to the user automatically. Is anything not working as expected? With that said, I’d be a little worried about this: Technically it is possible, but it seems to be a problem in the app review process. What does this mean? Did your app get rejected for this? If so, what was the reason? Are you trying to “get around” app review in some way?
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’23
Reply to Can I call setAlternateIconName without user consent?
It’s amusing that this guideline: This feature may not be used for dynamic, automatic, or serial changes, such as to reflect up-to-date weather information, calendar notifications, etc. ...basically tells you not to do something that the API doesn’t support anyway. It’s good to be thorough. But be mindful of this part: and the app includes settings to revert to the original icon. So just changing the icon in response to navigation actions within the app may not satisfy the guideline. Since we’re down to trying to parse the exact meaning of the review guidelines, I think you should just submit your app and see how it goes.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’23
Reply to can't make this work.any ideas why it ain't working?
Note that your struct needs to conform to Decodable in order to use JSONDecoder, like this: struct Vinyl: Decodable { // assuming the same name as in your 2019 Stack Overflow post And you should definitely switch if possible to Decodable and JSONDecoder as shown by @Claude31. Consider JSONSerialization unofficially deprecated for Swift. Now as for this issue in the original code: But it can't get through the line of the if let localData statement. I don't know why. The “don’t know why” is due to using try? which silently eats any error thrown by the JSONSerialization.jsonObject() call. If you change it to regular try and enclose it in a do / catch block, then the error it catches will tell you exactly what the problem is.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’23
Reply to How to capture all byte data of a class instance
Question A: Is there an existing API call or data type that allows me to pass in a class object and returns all the byte data ? I don’t actually know, but consider a case where an object does reference other objects. Does “all the byte data” mean you want to capture the entire object graph? That’s not necessarily what you really want. Question B: If question A is no, could you recommend/suggest a way to achieve this? Sounds like you just need a serialization scheme to convert an object to a byte stream. Grabbing the underlying bytes via Data(bytes:count:) is one way of course, but you could also implement a custom scheme to explicitly serialize all the object properties you need. Then I’m guessing that however you generate a byte stream representing an object, the fun part is that you are using XOR to diff successive entries in your undo stack and storing these diffs efficiently, probably taking advantage of the diffs containing a lot of 0x00 bytes. Is that the idea? If so, then any serialization scheme that produces the desired behavior should work.
Topic: App & System Services SubTopic: General Tags:
Feb ’23
Reply to Why "Open using Rosetta" is still needed to run on Simulator?
But why exactly do you need Rosetta on simulator? Is it due to a 3rd party framework that doesn’t yet have an ARM slice for simulator? If so, the right solution is to get that 3rd party vendor to update their framework. Easier said than done, of course. ours is an enterprise project that uses video and audio calling My company’s app has this exact problem due to a framework from the vendor of very well-known video conferencing app (maybe the same one). A workaround that works for many of us is to add a local no-op stub for the framework classes are missing on simulator. (You add the minimum needed to eliminate linker errors.) This lets the app build, and is sufficient for those of us who don’t actually need to use the functional area of the app that uses that particular framework. Maybe this trick could work for you too.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’23
Reply to Can I call setAlternateIconName without user consent?
You should be able to call setAlternateIconName whenever you like. Is it not working in your case? Make sure to check for success via the completion handler, or by catching any error thrown if using the async version. If it succeeds, the system should present an alert to the user automatically. Is anything not working as expected? With that said, I’d be a little worried about this: Technically it is possible, but it seems to be a problem in the app review process. What does this mean? Did your app get rejected for this? If so, what was the reason? Are you trying to “get around” app review in some way?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Not able to find the CarPlay capability
Just to clarify: did you already request and receive the CarPlay entitlement as described in the first paragraph of that documentation?
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to WeatherKit REST API new columns for CurrentWeather
Breakage aside, are the new fields also values from 0 to 1 but with a name ending in Pct? Or do they seem to go from 0 to 100? Either way, seems a little sloppy. Hopefully this is just a pre-release thing they are trying out for now.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Can I call setAlternateIconName without user consent?
It’s amusing that this guideline: This feature may not be used for dynamic, automatic, or serial changes, such as to reflect up-to-date weather information, calendar notifications, etc. ...basically tells you not to do something that the API doesn’t support anyway. It’s good to be thorough. But be mindful of this part: and the app includes settings to revert to the original icon. So just changing the icon in response to navigation actions within the app may not satisfy the guideline. Since we’re down to trying to parse the exact meaning of the review guidelines, I think you should just submit your app and see how it goes.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Where is the iOS 16.3 SDK? If I were missing it, where would I get it?
There isn’t always a new SDK for every OS release. From the user-facing release notes, it sounds like 16.3 doesn’t have any new APIs that would require a new SDK. And the developer-facing release notes for 16.3 says this: The iOS & iPadOS 16.2 SDK provides support to develop apps for iPhone and iPad running iOS & iPadOS 16.3.
Replies
Boosts
Views
Activity
Feb ’23
Reply to DateFormatter outputting wrong date on the 1st of Feb 2023
The bug is in your format string: DD means day of the year. You want dd which means day of the month. Also, there’s a subtle difference between YYYY and yyyy in some cases; see the Unicode spec linked from here.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to App Store iPad screenshots
If your app really does look different due to the changed safe area and the home indicator, then why not do your potential new users a favor and show them accurate screenshots. As to whether the reviewers would actually notice if you cheat... nobody here can answer that. ;-)
Replies
Boosts
Views
Activity
Feb ’23
Reply to Update Nginx for Xcode
You should treat Xcode like any other Apple product: :warning: No user serviceable parts inside. What are you trying to accomplish?
Replies
Boosts
Views
Activity
Feb ’23
Reply to can't make this work.any ideas why it ain't working?
Note that your struct needs to conform to Decodable in order to use JSONDecoder, like this: struct Vinyl: Decodable { // assuming the same name as in your 2019 Stack Overflow post And you should definitely switch if possible to Decodable and JSONDecoder as shown by @Claude31. Consider JSONSerialization unofficially deprecated for Swift. Now as for this issue in the original code: But it can't get through the line of the if let localData statement. I don't know why. The “don’t know why” is due to using try? which silently eats any error thrown by the JSONSerialization.jsonObject() call. If you change it to regular try and enclose it in a do / catch block, then the error it catches will tell you exactly what the problem is.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to How to capture all byte data of a class instance
Question A: Is there an existing API call or data type that allows me to pass in a class object and returns all the byte data ? I don’t actually know, but consider a case where an object does reference other objects. Does “all the byte data” mean you want to capture the entire object graph? That’s not necessarily what you really want. Question B: If question A is no, could you recommend/suggest a way to achieve this? Sounds like you just need a serialization scheme to convert an object to a byte stream. Grabbing the underlying bytes via Data(bytes:count:) is one way of course, but you could also implement a custom scheme to explicitly serialize all the object properties you need. Then I’m guessing that however you generate a byte stream representing an object, the fun part is that you are using XOR to diff successive entries in your undo stack and storing these diffs efficiently, probably taking advantage of the diffs containing a lot of 0x00 bytes. Is that the idea? If so, then any serialization scheme that produces the desired behavior should work.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Bundle Identifier for Device Testing
"com.example.GettingStarted" cannot be registered to your development team Are you using the actual bundle prefix com.example or are you just redacting your real domain name in order to post the question in the forum?
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Xcode 11.3.1
Old versions including 11.3.1 are available, but you may need a full paid developer account to access them. If you do have access, here’s the link.
Replies
Boosts
Views
Activity
Feb ’23
Reply to Why "Open using Rosetta" is still needed to run on Simulator?
But why exactly do you need Rosetta on simulator? Is it due to a 3rd party framework that doesn’t yet have an ARM slice for simulator? If so, the right solution is to get that 3rd party vendor to update their framework. Easier said than done, of course. ours is an enterprise project that uses video and audio calling My company’s app has this exact problem due to a framework from the vendor of very well-known video conferencing app (maybe the same one). A workaround that works for many of us is to add a local no-op stub for the framework classes are missing on simulator. (You add the minimum needed to eliminate linker errors.) This lets the app build, and is sufficient for those of us who don’t actually need to use the functional area of the app that uses that particular framework. Maybe this trick could work for you too.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Use one iPhone for debugging from 2 macbooks
We generally don’t answer “why” questions @eskimo That could be a candidate for tip 3 in Quinn’s Top Fourteen DevForums Tips.
Replies
Boosts
Views
Activity
Feb ’23
Reply to Is this bad practice?
Also, standard practice is that type names start with a capital letter and all other names start with a lowercase letter: static let defaultLocation = CLLocationCoordinate2D( /* ... */ ) // ^
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23