Created
December 24, 2022 18:45
-
-
Save mdb1/d51bc6d7399468f959603542605a3544 to your computer and use it in GitHub Desktop.
CGFloat Spacing Constants
This file contains 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
import Foundation | |
extension CGFloat { | |
/// Spacing constants to use across the app. | |
enum Spacing { | |
/// Extra small spacing. (4 points). | |
static let xSmall: CGFloat = 4.0 | |
/// Small spacing. (8 points). | |
static let small: CGFloat = 8.0 | |
/// Medium spacing. (16 points). | |
static let medium: CGFloat = 16.0 | |
/// Large spacing. (32 points). | |
static let large: CGFloat = 32.0 | |
} | |
} | |
// Usage: | |
VStack(spacing: .Spacing.large) { | |
Text("Hey") | |
Text("You") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment