-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftUI Support #1
Comments
Thanks! Should be pretty simple, when I get the time I'll add support. However at WWDC22 SwiftUI now automatically gets support for half-sheet overlays with |
Don't be so pessimistic! The only difference between you and an Apple Engineer is the title - everything is highly subjective and I believe that, under the same conditions, you could perform as good, if not better, than one!
I think you might be under-selling your little framework here. SwiftUI's sheets act as modals, as in, they'll be placed on top of an existing view instead of sharing (splitting) the space with other view. I've yet to check the new sheets Apple presented at WWDC22, but assuming I'm right, your framework does a complete different job (both technically and visually) than Apple Sheets - and that's great, because that's exactly what I'm looking for :D |
That's true, thanks! |
Hey, I'm gonna have a go at porting this to SwiftUI |
Nice, thanks @FunkyMonkey729! Comment any problems you run into here |
I've got it kind of working, it's all good apart from animations a kinda broken, for example in this view, struct ContentView: View {
@State var toggleColour = false
var body: some View {
SplitSheetView(isPresented: $isPresented) {
ZStack {
if toggleColour {
Color.orange
} else {
Color.green
}
Button("Toggle colour") {
withAnimation {
toggleColour.toggle()
}
}
}
} sheet: {
Color.red
}
}
} it wouldn't animate between green and orange, only cut between them. Also observing the |
@FunkyMonkey729 any updates on this? Would love to use something like this in my SwiftUI project. |
@LeoSM-07 I can't find a way of getting the main view to observe if the sheet is showing or not without breaking the presenting and hiding animations. Pretty sure it's impossible as it involves redrawing the SwiftUI views as the presenting animation happens, which breaks the animation. Might try and rewrite it all in SwiftUI if I have time this week. |
First of all, great work on the framework 馃憤
Are you planning to extend it with a SwiftUI version that uses a
Representable
? 馃The text was updated successfully, but these errors were encountered: