Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created June 15, 2021 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/28737be7c5c19268f9b1d6649ed2c1df to your computer and use it in GitHub Desktop.
Save laevandus/28737be7c5c19268f9b1d6649ed2c1df to your computer and use it in GitHub Desktop.
struct Message: Hashable, Codable {
let id: String
let value: String
}
struct MessageAttribute: CodableAttributedStringKey, MarkdownDecodableAttributedStringKey {
typealias Value = Message
static var name: String = "secretMessage"
}
extension AttributeScopes {
struct MyAppAttributes: AttributeScope {
let message: MessageAttribute
let swiftUI: SwiftUIAttributes
}
var myApp: MyAppAttributes.Type { MyAppAttributes.self }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment