Skip to content

Instantly share code, notes, and snippets.

@advantis
Created January 9, 2015 11:02
Show Gist options
  • Save advantis/0d774efb8b98d567ed33 to your computer and use it in GitHub Desktop.
Save advantis/0d774efb8b98d567ed33 to your computer and use it in GitHub Desktop.
Pixel Constraint
import UIKit
private let scale = UIScreen.mainScreen().scale
class PixelConstraint: NSLayoutConstraint {
override var constant: CGFloat {
get { return super.constant / scale }
set(value) { super.constant = value }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment