Skip to content

Instantly share code, notes, and snippets.

@jpmcglone
Last active March 25, 2020 20:08
Show Gist options
  • Save jpmcglone/5d442263bf969e2ed490acf0fce77d42 to your computer and use it in GitHub Desktop.
Save jpmcglone/5d442263bf969e2ed490acf0fce77d42 to your computer and use it in GitHub Desktop.
import SwiftUI
public extension Spacer {
static func exactly(_ value: CGFloat) -> some View {
Spacer()
.frame(
minWidth: value,
idealWidth: value,
maxWidth: value,
minHeight: value,
idealHeight: value,
maxHeight: value
)
}
static func idealOrLess(_ value: CGFloat) -> some View {
Spacer()
.frame(
idealWidth: value,
maxWidth: value,
idealHeight: value,
maxHeight: value
)
}
static func idealOrMore(_ value: CGFloat) -> some View {
Spacer()
.frame(
minWidth: value,
idealWidth: value,
minHeight: value,
idealHeight: value
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment