Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Animate NSLayoutConstraint.constant using signals #9

Closed
wants to merge 2 commits into from

Conversation

indragiek
Copy link
Member

First attempt at implementing #4.

import ReactiveCocoa

// Wraps an NSLayoutConstraint for animating its constant using signals.
public struct RANConstraint {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this be named Constraint instead? I named it this way to be consistent with RANView.

@jspahrsummers
Copy link
Member

Looks good upon a quick skim. ✨

@indragiek Realistically, I probably won't have a whole lot of time to review every PR on here, but I would love to see the project continue—so please feel free to self-merge, if that's helpful. 🙏

Of course, if you ever specifically want me to chime in, mention me and I'll prioritize it.

@indragiek
Copy link
Member Author

@jspahrsummers Thanks, I'll try my best to keep this going when I have time. I'll see what I can do about putting together some examples as well.

Just a question with regards to what's in this PR: do you think it would be an expected behaviour to have signals bound to constraints even after they have been deactivated (i.e. removed from their view)?

@jspahrsummers
Copy link
Member

do you think it would be an expected behaviour to have signals bound to constraints even after they have been deactivated (i.e. removed from their view)?

Yeah, I think so. The binding should remain in effect, even though it won't affect what displays on screen.

Only when the constraint is deallocated should the binding cancel, IMO.

@indragiek
Copy link
Member Author

@jspahrsummers 👍 I'll come up with an addition to the example app for this just to make sure everything works as intended and self merge.

@mdiep mdiep closed this Apr 2, 2019
@mdiep mdiep deleted the animate-constraints branch April 2, 2019 11:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants