Created
January 9, 2015 11:02
-
-
Save advantis/0d774efb8b98d567ed33 to your computer and use it in GitHub Desktop.
Pixel Constraint
This file contains hidden or 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
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