Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Adding support for autolayout constraint multipliers #301

Closed
wants to merge 2 commits into from
Closed

Adding support for autolayout constraint multipliers #301

wants to merge 2 commits into from

Conversation

andrewjl
Copy link

I've accommodated the readonly multiplier property the best way I could think of here. Also added the constraint constant property to the unit tests as it was missing.

Since the multiplier property of NSLayoutConstraint is read-only, we recreate the constraint with all existing attributes besides the desired multiplier.
@andrewjl
Copy link
Author

Getting a Travis CI build error related to tvos. (pod install is failing on there) Can anyone recommend a workaround?

^(NSLayoutConstraint *obj, const CGFloat values[]) {
// The multiplier property is read-only so recreate the constraint with all existing attributes
// besides the desired multiplier.
obj = [NSLayoutConstraint constraintWithItem:obj.firstItem
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I'm not sure if this will work. Wouldn't you need to also update / replace the constraint on the view it's attached to?

@andrewjl
Copy link
Author

Having trouble updating / replacing the constraint in the view it's attached to. Closing this for now.

@andrewjl andrewjl closed this Jan 20, 2016
@ghost ghost mentioned this pull request Feb 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants