Releases: sakiyamaK/DeclarativeUIKit
Releases · sakiyamaK/DeclarativeUIKit
2.2.0
2.1.0
2.0.2
2.0.1
2.0.0
JP
declarativeメソッドのresetパラメータのデフォルト値をtrueからfalseに変更しました
これによりdeclarativeメソッドもより簡易的に繋げることができます
before
self.declarative {
UIStackView.vertical {
UIlabel()
UIlabel()
}
}.declarative(safeArea: .init(all: false), reset: false) {
//SafeAreaを無視したレイアウトを上から足す
UIButton()
.bottom()
.right()
.offset(x: -16, y: -16)
}
after
self.declarative {
UIStackView.vertical {
UIlabel()
UIlabel()
}
}.declarative(safeArea: .init(all: false)) {
//SafeAreaを無視したレイアウトを上から足す
UIButton()
.bottom()
.right()
.offset(x: -16, y: -16)
}
EN
Changed the default value of the reset parameter of the declarative method from true to false
This allows declarative methods to be connected in a simpler way.
before
self.declarative {
UIStackView.vertical {
UIlabel()
UIlabel()
}
}.declarative(safeArea: .init(all: false), reset: false) {
// Add the layout ignoring the SafeArea from the top
UIButton()
.bottom()
.right()
.offset(x: -16, y: -16)
}
after
self.declarative {
UIStackView.vertical {
UIlabel()
UIlabel()
}
}.declarative(safeArea: .init(all: false)) {
// Add the layout ignoring the SafeArea from the top
UIButton()
.bottom()
.right()
.offset(x: -16, y: -16)
}
1.15.0
1.14.0
1.13.0
- declarative UISheetPresentationController
- applyView, applySheetPresentationController method
UIViewController()
.applyView {
$0.backgroundColor(.white)
}
.declarative {
UIScrollView.vertical {
UIStackView.vertical {
(0...50).compactMap { idx in
UILabel("\(idx)でーす")
.textAlignment(.center)
.contentPriorities(.init(vertical: .required))
.customSpacing(8)
}
}
.padding(insets: .init(vertical: 30))
}
}
.applySheetPresentationController {
$0.detents([.large(), .medium()])
.preferredCornerRadius(16)
.prefersGrabberVisible(true)
.prefersScrollingExpandsWhenScrolledToEdge(false)
.largestUndimmedDetentIdentifier(.large)
}
.present(from: self, animated: true)
1.12.0
deperacated imperative method
UIButton("deprecated imperative").imperative {
let button = $0 as! UIButton
button.titleLabel?.font = UIFont.systemFont(ofSize: 12)
button.titleLabel?.textColor = .green
}
Let's use apply
no cast needed
UIButton("apply").apply {
// no use cast
// let button = $0 as! UIButton
$0.titleLabel?.font = UIFont.systemFont(ofSize: 12)
$0.titleLabel?.textColor = .green
}