Skip to content

Make the replaceGroup argument optional#239

Merged
orta merged 1 commit intorobb:masterfrom
strangeliu:master
Sep 28, 2016
Merged

Make the replaceGroup argument optional#239
orta merged 1 commit intorobb:masterfrom
strangeliu:master

Conversation

@strangeliu
Copy link
Copy Markdown
Contributor

@strangeliu strangeliu commented Sep 28, 2016

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

@orta
Copy link
Copy Markdown
Collaborator

orta commented Sep 28, 2016

👍 Awesome - thanks!

@orta orta merged commit 06b3cbd into robb:master Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants