Skip to content

Instantly share code, notes, and snippets.

@saoudrizwan
Last active December 31, 2016 06:56
Show Gist options
  • Save saoudrizwan/ea9d564d27733efb58dde06c9b4ccf7d to your computer and use it in GitHub Desktop.
Save saoudrizwan/ea9d564d27733efb58dde06c9b4ccf7d to your computer and use it in GitHub Desktop.
linesConvergingAnimation = UIViewPropertyAnimator(duration: 0.2, curve: UIViewAnimationCurve.linear, animations: {
// Set the new constraints
self.firstLine.snp.remakeConstraints({ (make) in
make.height.equalTo(self.lineHeight) // constant
make.width.equalTo(self.containerView.snp.width)
make.centerX.equalTo(self.containerView.snp.centerX)
make.centerY.equalTo(self.containerView.snp.centerY)
})
self.thirdLine.snp.remakeConstraints({ (make) in
make.height.equalTo(self.lineHeight) // constant
make.width.equalTo(self.containerView.snp.width)
make.centerX.equalTo(self.containerView.snp.centerX)
make.centerY.equalTo(self.containerView.snp.centerY)
})
// Apply the new constraints on the view
self.view.layoutIfNeeded()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment