Releases: maxvol/JSONLayout
Releases · maxvol/JSONLayout
SPM support
0.1.1
better lambda name(s)
try? Layout(name: "layout").configure {
// customize format options
$0.formatOptions = { (id) -> NSLayoutConstraint.FormatOptions in [] }
// provide view yourself (if the class does not have default initializer) or fall back to the default implementation
$0.viewOfType = { (type, id) -> UIView? in return Layout.view(of: type) }
// configure a newly created view
$0.didCreateView = { (view, id) -> Void in return }
}
.inflate(in: view)
replaced delegate with lambdas
try? Layout(name: "layout").configure {
// customize format options
$0.formatOptions = { (id) -> NSLayoutConstraint.FormatOptions in [] }
// provide view yourself (if the class does not have default initializer) or fall back to the default implementation
$0.viewOfType = { (type, id) -> UIView? in return Layout.view(of: type) }
// configure a newly created view
$0.didCreate = { (view, id) -> Void in return }
}
.inflate(in: view)
more delegate
public protocol LayoutDelegate {
func view(of type: String, for id: String) -> UIView?
func didCreate(_ view: UIView, for id: String)
func formatOptions(for constraint: String) -> NSLayoutConstraint.FormatOptions
}
func didCreate(_ view: UIView, with id: String)
0.0.4 delegate: func didCreate(_ view: UIView, with id: String)
FormatOptions delegate
0.0.3 Merge remote-tracking branch 'refs/remotes/origin/master'