Post

Replies

Boosts

Views

Activity

Reply to SwiftUI onAppear called inconsistently based on the presence of listStyle
Thank you for this detailed response! The scenario I am trying to solve is simple: in my actual app, each row contains an Image that has data we need to load remotely, just like an AsyncImage. Because we support iOS 14 we cannot use AsyncImage, so in our implementation we have a load method that is invoked in an onAppear block. It appears that Apple's implementation of AsyncImage has no such method exposed, and so the network operation must be triggered in the constructor? If we have a list of many thousands of items, but only a dozen are shown onscreen, I assume that SwiftUI is smart enough to only construct what it needs (plus a few extra above or below what is shown), vs constructing thousands all at once and expecting the code to use something akin to onAppear to figure out when to actually start initializing? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Reply to iOS user with language of "en", no region code, translation lookup fails
It appears that this is the method that returns "en": [NSLocale currentLocale].localeIdentifier Normally it should return something like en_US, but we now have two users for whom this value appears to only return en and for which localizations are not working properly. The first user apparently reset his phone and got things working. The second user has shown us a screenshot of his phone and it does appear to show "English -> United States" in his settings.
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’22
Reply to Which thread to call uploadTask from URLSession
Apple has historically not shipped APIs that are blocking -- if so, they are marked as async or include some kind of callback. As a result, I believe that this indicates some kind of problem with the operating system and potentially a bug that should be reported to Apple...?
Replies
Boosts
Views
Activity
Nov ’24
Reply to SwiftUI onAppear called inconsistently based on the presence of listStyle
Thank you for this detailed response! The scenario I am trying to solve is simple: in my actual app, each row contains an Image that has data we need to load remotely, just like an AsyncImage. Because we support iOS 14 we cannot use AsyncImage, so in our implementation we have a load method that is invoked in an onAppear block. It appears that Apple's implementation of AsyncImage has no such method exposed, and so the network operation must be triggered in the constructor? If we have a list of many thousands of items, but only a dozen are shown onscreen, I assume that SwiftUI is smart enough to only construct what it needs (plus a few extra above or below what is shown), vs constructing thousands all at once and expecting the code to use something akin to onAppear to figure out when to actually start initializing? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to iOS user with language of "en", no region code, translation lookup fails
It appears that this is the method that returns "en": [NSLocale currentLocale].localeIdentifier Normally it should return something like en_US, but we now have two users for whom this value appears to only return en and for which localizations are not working properly. The first user apparently reset his phone and got things working. The second user has shown us a screenshot of his phone and it does appear to show "English -> United States" in his settings.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to init MKMapView exception in Xcode 13.0 beta
I hit this same problem too. Mine is coming via a XIB not a direct object invocation
Replies
Boosts
Views
Activity
Jun ’21