applidium/OverlayContainer

SwiftUI support needed!

Closed this issue · 5 comments

Would be very good to have SwiftUI support.

I thought a bit about it. SwitUI does not provide accessors to the UIKit components used under the hood. So you won't be able to set a driving scroll view for example.

What could the API look like?

I do not know how it could look. My self needs to investigate around this.

Could you not create some kind of delegate that simply captures the content offset? @gaetanzanella

https://medium.com/@maxnatchanon/swiftui-how-to-get-content-offset-from-scrollview-5ce1f84603ec

SwiftUI support is coming 🎉 .

import SwiftUI
import OverlayContainer

struct SUIExampleView: View {

    var body: some View {
        Color.red.floatingOverlay(Color.blue)
    }
}

Here is the roadmap:

  • Create overlay modifier
  • Create overlay style modifier
  • Create overlay proxy to enable overlay movements
  • Create overlay observer modifiers
  • Create overlay layout modifiers
  • Choice whether the SwiftUI extensions should be integrated right inside the current project or in a new one => a new one

SwiftUI won't be supported soon but you can use the OverlayContainerCoordinator as a sample code to use the overlay container in a SwiftUI project.

A first beta is available 🎉