Swiftはバージョンアップのたびに、様々な機能が追加されるのも魅力です。
そんなSwiftの機能を、HTMLをお手軽に作成するHTMLビルダーを例にしてご紹介するセッションになります。
Swiftの言語機能を活かして、ちょっと実装をするだけでHTMLが出力できるようになります。
html.children {
head.children {
meta(charset: "UTF-8")
meta(name: "description", content: "Free Web tutorials")
meta(name: "keywords", content: "HTML, CSS, JavaScript")
meta(name: "author", content: "John Doe")
}
body.children {
p.children {
"All meta information goes inside the head section."
}
}
}
このセッションでは、以下の機能を使って、HTMLBuilderを作り、そのそれぞれの機能をご紹介できればと思います。