Skip to content

Releases: yukiny0811/SwiftyHTMLBuilder

v2.0.0

01 Feb 16:13
d4c46f5
Compare
Choose a tag to compare

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

30 Jul 17:19
12f2850
Compare
Choose a tag to compare
Update HTMLBuilder.swift