Generable(description:)
Conforms a type to Generable protocol.
Declaration
@attached(extension, conformances: Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) macro Generable(description: String? = nil)Mentioned in
Overview
You can apply this macro to structures and enumerations.
@Generable
struct NovelIdea {
@Guide(description: "A short title")
let title: String
@Guide(description: "A short subtitle for the novel")
let subtitle: String
@Guide(description: "The genre of the novel")
let genre: Genre
}
@Generable
enum Genre {
case fiction
case nonFiction
}