Post

Replies

Boosts

Views

Activity

AVRoutePickerView player property
Hi, I am using AVRoutePickerView on macOS via NSViewRepresentable. I am setting the player property with a AVPlayer object. But when I choose via AVRoutePicker one of my HomePods, AVPlayer is ignoring the setting and is still using my Mac as output. Strangely if I left the player property nil and then choosing one of my HomePods via AVRoutePickerView it is working, but only for one AVPlayer, other AVPlayer will be muted. How can I force AVRoutePickerView to use its AVPlayer property? I am testing this with macOS 12.4. Thank you Oleg
0
0
559
Jun ’22
macOS draws complete SwiftUI view graph when app gets active
I have created a SwiftUI based app, a small sidebar list left and a bigger list on the right side. The big list has thousands of elements, visible list rows are created lazily. When I make my app the active App via Command+Tab, there is a few seconds long delay until I can use my app again. I have used Instruments Time Profiler, there a a lot calls to updateConstraints. It seems that macOS is rendering the whole SwiftUI view graph when the app gets active. I do not understand why this is happening, views should only be rendered when my data has changed. I have set an breakpoint into my body implementations, the debugger is not called. So the drawing seems only to happen inside of Appkit. How can I prevent this?
0
0
426
May ’21