Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created Jun 15, 2021
Embed
What would you like to do?
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