getsidetrack / swiftui-pipify

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

Seamless Docking #12

Closed Sherlouk closed 2 years ago

Sherlouk commented 2 years ago

At present, we use a hidden view to transition into the PiP state. This can make the transition a bit jerky and potentially confusing. It would be nice to give the developers the option to dock an existing view instead of docking a hidden view.

This would be achieved by removing the content: parameter in the existing dockable modifier. If no content is provided, the attached view is docked. If content is provided, that is docked instead.

jordibruin commented 2 years ago

Adding this to the layerView makes it fade in and out 🙂

.offset(x: UIScreen.main.bounds.width, y: UIScreen.main.bounds.height)