Post

Replies

Boosts

Views

Activity

Reply to iOS 16 unexpected rotation behaviour
Somewhat related, the documentation for setNeedsUpdateOfSupportedInterfaceOrientations https://developer.apple.com/documentation/uikit/uiviewcontroller/4047535-setneedsupdateofsupportedinterfa states "By default, this method animates any changes to orientation. To perform a nonanimated update, call this method from performWithoutAnimation(_:)." and when I attempt to use performWithoutAnimation, it randomly doesn't have an effect half of the time, and I see the unwanted interface orientation change animation.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’22
Reply to UITableView (UITableViewStyleGrouped) missing nice top padding in popovers
You might be able to override this behavior by assigning a blank view to tableView.tableHeaderView with the height that you'd like, but there's more to this rabbit hole. The visual style of table views in popovers is inconsistent across Apple's apps, like Calendar, Pages, and Numbers, so it's unclear what the right thing to do is. Depending on the context, the table view's background color may be a flat gray instead of systemGroupedBackground, as recommended by the HIG. The padding you mentioned may or may not be present. The popover's drop shadow may be darker than the default. When view controllers are pushed in the context of a navigation view controller in a popover, the popover may elegantly change size during the transition, compared to the default behavior which is to change size only after the push transition has completed. Animating the popover's size in concert with the push transition is tricky to achieve and requires a lot of experimentation. I haven't looked at iOS 16 yet.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’22
Reply to AVAudioEngine thread-safety
I've just written code which makes the same assumption about AVAudioEngine thread safety, and I'd like to know the answer as well. I share the similar concerns about the general lack of documentation about thread safety. When I had less iOS experience, I created a project based on GameKit and struggled with unreliable behavior. Years later I wondered if the problems might have been caused by various GameKit network request completion handlers being called on threads other than the main thread, and I didn't know enough yet to consider this possibility, as it was not mentioned in the documentation. Now I write assert(Thread.isMainThread) everywhere I suspect there's even the slightest chance an API completion handler might not be called on the main thread. Based on my past experience with other parts of AVFoundation, my instincts tell me that it might be safe to restrict all interaction with a single AVAudioEngine object to a background thread. If my code blows up in the next few months, I'll post again here.
Topic: Media Technologies SubTopic: Audio Tags:
May ’22