getsidetrack / swiftui-pipify

A SwiftUI component for launching custom picture-in-picture experiences
MIT License
155 stars 14 forks source link

Provide Render Size #6

Closed Sherlouk closed 2 years ago

Sherlouk commented 2 years ago

Apple provides us with a delegate call whenever the render size of the PiP window is changed. This is because not only does Apple themselves mostly decide the size, but also the user can resize the window.

Some clients may wish to dynamically change what content is shown based on how large the window is on the screen - as such it would be good to route this information through to the view when we render it. This could likely be done with a custom environment key.