Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introducing Function Builder
Search
100059
December 17, 2019
Technology
3
730
Introducing Function Builder
potatotips #267
2019/12/17
100059
December 17, 2019
Tweet
Share
More Decks by 100059
See All by 100059
アクセシビリティが高いFlutterアプリケーションを開発する
akihisasengoku
2
3.2k
Flutter Accessibility
akihisasengoku
1
580
組織作りで大切にしていること
akihisasengoku
0
86
Bitriseのリファクタリング
akihisasengoku
1
200
Awaiting for New UI in iOS 13
akihisasengoku
0
1.3k
RxSwiftのテスト入門
akihisasengoku
1
990
Other Decks in Technology
See All in Technology
Deno Deploy で Web Cache API を 使えるようになったので試した知見
toranoana
1
110
OPENLOGI Company Profile for engineer
hr01
1
12k
WSUSが非推奨に!? Windowsの更新管理を改めて勉強する!
ebibibi
0
190
業務ヒアリングと知識の呪い
tamai_63
0
290
スタサプ ForSCHOOLアプリのシンプルな設計
recruitengineers
PRO
3
630
Amazon ECS & AWS Fargate 今昔物語 / past and present stories of Amazon ECS and AWS Fargate
iselegant
14
2.2k
Efficient zero-copy networking using io_uring
ennael
PRO
0
380
New Relicを活用したシステム監視の強化とオブザーバビリティ向上
sugoto911
1
110
Slackbot × RAG で実現する社内情報検索の最適化
howdy39
2
340
AWS Lambdaで実現するスケーラブルで低コストなWebサービス構築/YAPC::Hakodate2024
fujiwara3
7
3.6k
CData Virtuality を活かせるキーシナリオと製品デモ
cdataj
0
230
Low Latency Join Method for Distributed DBMS
yugabytejapan
0
180
Featured
See All Featured
For a Future-Friendly Web
brad_frost
174
9.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
The Cost Of JavaScript in 2023
addyosmani
43
5.9k
Rails Girls Zürich Keynote
gr2m
93
13k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
10
1.5k
Making Projects Easy
brettharned
115
5.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
A Modern Web Designer's Workflow
chriscoyier
692
190k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
KATA
mclloyd
27
13k
Transcript
Introducing Function Builder potatotips #267 2019/12/17
Akihisa Sengoku @akihisasen גࣜձࣾαΠόʔΤʔδΣϯτ AmebaʢΞϝʔόʣ iOSΤϯδχΞ
Function Builderͱʁ
4XJGU6*ͰΘΕ͍ͯΔΫϩʔδϟʔతͳͷʁ
%4-Λॻ͘͜ͱ͕Ͱ͖ΔΑ͏ʹͳͬͨʁ
4XJGUͰՃ͞Εͨ৽ػೳ 1SPQPTBM 'PSVN
BuilderͷϧʔϧʹैͬͯؔΛ ҉తʹม͢Δ͜ͱ͕Ͱ͖Δ #VJMEFSΛ దԠͨؔ͠ #VJMEFSϧʔϧʹ Ԡͯؔ͡Λม #VJMEFSΛఆٛ #VJMEFSΛ దԠ
None
None
Function BuilderʹΑΓ ಠࣗͷDSLΛΑΓ࡞͘͢͠ͳͬͨ - Structure Data (json, XML) - UI
View Hierarchies - HTML DOM Hierarchies
࡞Γํ!
#VJMEFSͷ࡞ํ๏ʹ͍ͭͯ
Builderͷ࡞ํ๏ 1. struct or classͷલʹ`@_functionBuilder`Λ͚ͭͯ ఆٛ͢Δɻ 2. static func Ͱ
`buildBlock(_ components: Component...) -> Component` Λఆٛ͢Δɻ
ͦͷଞͷbuildͷ࣮ • buildExpression(_ expression: Expression) -> Component • buildFunction(_ components:
Component...) - > Return • buildDo(_ components: Component...) -> Component • buildOptional(_ component: Component?) -> Component
'VODUJPO#VJMEFSͷ༻ํ๏
Function Builderͷ༻ํ๏ 1. Function BuilderΛ༻͍ͨؔ͠ͷલʹ @FunctionBuilder໊Λ͚ͭΔ 2. BuilderͷbuildBlockʹରԠ͢ΔҾΛɺ վߦ۠ΓͰهड़
ؔͷҾͷΫϩʔδϟͰFunction Builder Λ༻͢Δ͜ͱ͕Ͱ͖Δ
None
ϓϩμΫτಋೖ
SwiftUI HTML NSAttributedString Network UIKit ϓϩμΫτಋೖ: DSL
Amebaͷಋೖྫ NSAttributedStringͷIFΛ៉ྷʹ 5JQT
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