Post

Replies

Boosts

Views

Activity

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 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?
Is it possible to call a specific screen What does this mean? It doesn’t seem to correspond to the title of your post. without user consent That’s usually a red flag here in Apple-land. What exactly are you trying to accomplish? Note that setAlternateIconName always presents an alert after the change, so you can’t quietly change the icon without the user noticing. And while there doesn’t seem to be any specific discussion of this in the HIG or API documentation, the intent of this API is pretty clear: to let the user pick an app icon they like, such as a sports team logo or a more pleasing color scheme. It doesn’t support using the icon to display useful information like the built-in calendar and clock apps do.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’23
Reply to Hashable, Equatable and Measurement
That condition always needs to hold, or else the type wouldn’t work correctly in hashed collections such as dictionaries and sets. Those work on the assumption that equal values being compared (such as a dictionary keys or set members) will first have equal hashes, and then have equal values. If you need (for example) 1 meter and 100 centimeters to be considered different for displaying as separate items in a list or something, then you can make a wrapper type that implements equality and hashing appropriately. But note this would require them to be considered not equal, and then it’s not obvious what the other comparison operations (greater-than and less-than) actually mean.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’23
Reply to URLSessionDownloadTaskDelegate functions not called when using URLSession.download(for:), but works when using URLSession.downloadTask(with:)
Note that the full signature for URLSession.download(for:) is actually this: func download(for request: URLRequest, delegate: URLSessionTaskDelegate? = nil) async throws -> (URL, URLResponse) So I’m thinking this means the async version ignores the session’s delegate and only uses the optional delegate you can pass in here. Why ignore the session delegate? Just a guess, but the session delegate is documented as running on a specific OperationQueue that you specify when creating the session. But the async version doesn’t say what queue the delegate may run on. So this API design allows it to run on a different queue than OperationQueue used for the old-style tasks.
Jan ’23