Skip to content
RedRimmedBox edited this page Apr 11, 2023 · 2 revisions

新しい Attribute の作り方

旧 API (〜v1)

let attribute = [.fontName: "times", .fontSize: 32]
  • 辞書型
  • Value は Any 型 (コード補完が効かない)

新 API(v2〜)

let attribute = .fontName("times").fontSize(32)
  • indirect 列挙体
  • Value は静的 (コード補完が効く)
Clone this wiki locally