Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open up Target protocols #562

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Open up Target protocols #562

wants to merge 1 commit into from

Conversation

gemedet
Copy link

@gemedet gemedet commented Dec 5, 2018

This PR updates the protocol requirements for ConstraintConstantTarget, ConstraintOffsetTarget, and ConstraintInsetTarget to be public (just like ConstraintMultiplierTarget), allowing for conformance by custom types:

enum Margin: Int, ConstraintOffsetTarget {
    case small = 10
    case large = 20
}

...

make.left.equalToSuperview().offset(Margin.small)

I also included some RawRepresentable extensions, so that opting-in can be as easy as putting it in the type declaration. If that's out of scope, these can be omitted, leaving implementations to the user.

Copy link

@Overcot Overcot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rebase to new develop?

@gemedet gemedet force-pushed the targets branch 2 times, most recently from c35f650 to 26f1791 Compare November 27, 2019 15:47
@gemedet gemedet force-pushed the targets branch 2 times, most recently from 10d757f to 50d0405 Compare July 10, 2020 07:34
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.

None yet

3 participants