Last active
March 17, 2016 01:29
-
-
Save andrewdolce/c679af29cd88f1d1d4fe to your computer and use it in GitHub Desktop.
Social Tunes Sharer Code Sample: Changing Constraints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Andrew’s code | |
private func open() { | |
// First shift the bottom view all the way to the right | |
bottomViewLeading.constant = CGRectGetWidth(shareContainerView.bounds) | |
view.layoutIfNeeded() | |
// Now animate the views into place | |
topViewLeading.constant = -CGRectGetWidth(shareContainerView.bounds) | |
bottomViewLeading.constant = 0 | |
UIView.animateWithDuration(slideAnimationDuration) { | |
self.view.layoutIfNeeded() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment