while there is a optional constraintGroup that i have to replace it when it's not nil, i have do like this
var replaceGroup: ConstraintGroup?
if let replaceGroup = replaceGroup {
constrain(view, replace: replaceGroup) { view in
// new constrains
}
} else {
constrain(view) { view in
// new constrains
}
}
or
constrain(view, replace: replaceGroup ?? ConstraintGroup()) { view in
// new constrains
}
both are not convenient, so make the replaceGroup argument optional for convenient
while there is a optional constraintGroup that i have to replace it when it's not nil, i have do like this
or
both are not convenient, so make the replaceGroup argument optional for convenient