Skip to content

Instantly share code, notes, and snippets.

@jpmcglone
Last active March 3, 2020 23:54
Show Gist options
  • Save jpmcglone/d31214ba582ce49a5e760c35b9676cdf to your computer and use it in GitHub Desktop.
Save jpmcglone/d31214ba582ce49a5e760c35b9676cdf to your computer and use it in GitHub Desktop.
public struct VSpacer: View {
private let spacing: CGFloat
public init(_ spacing: CGFloat) {
self.spacing = spacing
}
public var body: some View {
Spacer()
.frame(idealHeight: spacing, maxHeight: spacing)
}
}
public struct HSpacer: View {
private let spacing: CGFloat
public init(_ spacing: CGFloat) {
self.spacing = spacing
}
public var body: some View {
Spacer()
.frame(idealWidth: spacing, maxWidth: spacing)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment