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