Created
December 7, 2020 05:09
-
-
Save emma-k-alexandra/e7ea42e3a44dda33672cbfcb43f4365b to your computer and use it in GitHub Desktop.
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
enum Content<T: View> { | |
case text(ContentText) | |
case link(Link<T>) | |
} | |
// A collection of either ContentText or Link views | |
// This text taken from https://developer.apple.com/documentation/swiftui/link | |
let content: [Content<Text>] = [ | |
.text(ContentText("As with other views, you can style links using standard view modifiers depending on the view type of the link’s label. For example, a ")), | |
.link(Link("Text", destination: URL(string: "https://developer.apple.com/documentation/swiftui/text")!)), | |
.text(ContentText(" label could be modified with a custom ")), | |
.link(Link("font(_:)", destination: URL(string: "https://developer.apple.com/documentation/swiftui/view/font(_:)")!)), | |
.text(ContentText(" or ")), | |
.link(Link("foregroundColor(_:)", destination: URL(string: "https://developer.apple.com/documentation/swiftui/view/foregroundcolor(_:)")!)), | |
.text(ContentText(" to customize the appearance of the link in your app’s UI.")) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment