Created
February 19, 2022 21:47
-
-
Save aheze/503191612b30d99bcd550128c13db473 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State var present = false | |
var body: some View { | |
Button("Present popover!") { | |
present = true | |
} | |
.frameTag("Button") | |
.popover(present: $present) { | |
Text("Hi, I'm a popover.") | |
.padding() | |
.foregroundColor(.white) | |
.background(.blue) | |
.cornerRadius(16) | |
} background: { | |
PopoverReader { context in | |
Templates.CurveConnector( | |
start: context.frame.point(at: .top), | |
end: context.window.frameTagged("Button").point(at: .bottom) | |
) | |
.stroke(Color.blue, lineWidth: 4) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment