-
Notifications
You must be signed in to change notification settings - Fork 18
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Splitter contents lag behind animation #40
Comments
Just to double-check, it's the noticeable lag between the button and the splitter it's contained-by that shows up on toggling hide/show? I think I need to do a matchedGeometryEffect, but let me take a look. |
Yes. The button contained is switched (to reflect the direction of the click in the next position) but it's drawn directly at the destination. Doesn't seem to "travel" with the animation and the splitter. The splitter then catches up to it. |
If you're on iOS 17, adding in
Not sure what the easy pre-iOS17 fix would be, frankly. |
Thanks! This worked well. iOS17 as a requirement is OK. |
Hi.
I have a custom splitter where in the middle there's a drag icon (three lines) and on the right a button to collapse down or return back.
I must be doing something wrong, since while everything works, the splitter itself lags. behind the icon for the button that triggers the resize animation.
Can be tested by pasting this in a new swift view file (preview with iPhone). The preview has vertical coloured spacers for top and bottom):
`
import Foundation
import SwiftUI
import SplitView
struct listListsSplitter: SplitDivider {
@ObservedObject var layout: LayoutHolder
@ObservedObject var hide: SideHolder
@ObservedObject var styling: SplitStyling
@State private var hideButton: Bool = false
}
#Preview {
let layout = LayoutHolder()
let hide = SideHolder()
}
`
This screenshot shows the splitter catching up with the label:
And this one shows the final state:
The text was updated successfully, but these errors were encountered: