Releases: yukiny0811/SwiftyHTMLBuilder
Releases · yukiny0811/SwiftyHTMLBuilder
v2.0.0
Release v2.0.0
- Write your HTML with SwiftUI-like structure (vstack, hstack, zstack)
- write css with autocomplete
- Modularize views
- Use loops (for) and conditional statements (if) to create views
- Create responsive UI with MediaQuery class
For Detailed description, see README.
Sample Code for modularization
class MyCell: HTML {
let count: Int
init(count: Int) {
self.count = count
}
var content: HTMLBlock {
hstack(spaceBetween: true) {
h3("cell")
h3(String(count))
}
.width(400, unit: .px)
.backgroundColor(.aliceblue)
}
}
// using MyCell
vstack(spacing: "10px") {
for i in 0..<10 {
if i.isMultiple(of: 2) {
MyCell(count: i).build()
}
}
}
v1.0.0
Update HTMLBuilder.swift