Last active
July 2, 2021 16:09
-
-
Save ishabazz/3869abc1ddd43c2972cdf0eae08853ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SwiftUI | |
extension ContentSizeCategory: Identifiable { | |
var id: Int { hashValue } | |
} | |
//Example | |
struct HelloWorld_Previews: PreviewProvider { | |
static var previews: some View { | |
Group { | |
ForEach(ContentSizeCategory.allCases){ size in | |
Text("Hello, World!") | |
.environment(\.sizeCategory, size) | |
} | |
} | |
.previewLayout(PreviewLayout.sizeThatFits) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment