Skip to content

Instantly share code, notes, and snippets.

@rickyngan
Created April 20, 2016 10:52
Show Gist options
  • Save rickyngan/ae63633d8fa6396669ec3dcc7331f341 to your computer and use it in GitHub Desktop.
Save rickyngan/ae63633d8fa6396669ec3dcc7331f341 to your computer and use it in GitHub Desktop.
UIView Padding
let labelHeight = self.addressLabel.intrinsicContentSize().height
self.mapView.padding = UIEdgeInsets(top: self.topLayoutGuide.length, left: 0,
bottom: labelHeight, right: 0)
UIView.animateWithDuration(0.25) {
//2
self.pinImageVerticalConstraint.constant = ((labelHeight - self.topLayoutGuide.length) * 0.5)
self.view.layoutIfNeeded()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment