Last active
July 18, 2020 15:53
-
-
Save apatronl/7fc73b6da36a9808ce2984c77854164a 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
struct EmojiWidgetView: View { | |
@Environment(\.widgetFamily) var family: WidgetFamily | |
let emojiDetails: EmojiDetails | |
@ViewBuilder | |
var body: some View { | |
switch family { | |
case .systemSmall: | |
SmallEmojiWidgetView(emojiDetails: emojiDetails) | |
case .systemMedium: | |
MediumEmojiWidgetView(emojiDetails: emojiDetails) | |
case .systemLarge: | |
LargeEmojiWidgetView(emojiDetails: emojiDetails) | |
@unknown default: | |
EmptyView() | |
} | |
} | |
} | |
struct SmallEmojiWidgetView: View { ... } | |
struct MediumEmojiWidgetView: View { ... } | |
struct LargeEmojiWidgetView: View { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment