Skip to content

Instantly share code, notes, and snippets.

@andrewdolce
Last active March 17, 2016 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewdolce/c679af29cd88f1d1d4fe to your computer and use it in GitHub Desktop.
Save andrewdolce/c679af29cd88f1d1d4fe to your computer and use it in GitHub Desktop.
Social Tunes Sharer Code Sample: Changing Constraints
// 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