Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing Function Builder

100059
December 17, 2019

Introducing Function Builder

potatotips #267
2019/12/17

100059

December 17, 2019
Tweet

More Decks by 100059

Other Decks in Technology

Transcript

  1. Builderͷ࡞੒ํ๏ 1. struct or classͷલʹ`@_functionBuilder`Λ͚ͭͯ ఆٛ͢Δɻ 2. static func Ͱ

    `buildBlock(_ components: Component...) -> Component` Λఆٛ͢Δɻ
  2. ͦͷଞͷbuildͷ࣮૷ • buildExpression(_ expression: Expression) -> Component • buildFunction(_ components:

    Component...) - > Return • buildDo(_ components: Component...) -> Component • buildOptional(_ component: Component?) -> Component
  3. What's New in Swift - WWDC2019 https://developer.apple.com/videos/play/ wwdc2019/402/ Function Builder

    - swift-evolution https://github.com/apple/swift-evolution/blob/ 9992cf3c11c2d5e0ea20bee98657d93902d5b17 4/proposals/XXXX-function-builders.md