Skip to content

Instantly share code, notes, and snippets.

@jeffypooo
Created December 29, 2019 18:08
Show Gist options
  • Save jeffypooo/2d95a36149e66394a4d9bac79bc24454 to your computer and use it in GitHub Desktop.
Save jeffypooo/2d95a36149e66394a4d9bac79bc24454 to your computer and use it in GitHub Desktop.
SwiftUI View Extensions
extension View {
func horizontalGuide(_ which: HorizontalAlignment, compute: @escaping (ViewDimensions) -> CGFloat) -> some View {
return alignmentGuide(which, computeValue: compute)
}
func verticalGuide(_ which: VerticalAlignment, compute: @escaping (ViewDimensions) -> CGFloat) -> some View {
return alignmentGuide(which, computeValue: compute)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment