Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created April 2, 2020 07:31
Show Gist options
  • Save wizard1066/e90becf1d32aea55c91934443eee48fd to your computer and use it in GitHub Desktop.
Save wizard1066/e90becf1d32aea55c91934443eee48fd to your computer and use it in GitHub Desktop.
abgwtpB
struct InsideView: View {
@Binding var rect: [CGRect]
var body: some View {
return GeometryReader { geometry in
Rectangle()
.fill(Color.yellow)
.frame(width: 64, height: 32, alignment: .center)
.opacity(0.5)
.onAppear {
self.rect.append(geometry.frame(in: .global))
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment