Created
April 6, 2019 12:03
-
-
Save mortenbekditlevsen/3ac2a21896dd775b0bb4410becd2e403 to your computer and use it in GitHub Desktop.
Any constants in the constraint will be interpreted as pixels instead of points
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
public class PixelBasedLayoutConstraint: NSLayoutConstraint { | |
override public func awakeFromNib() { | |
super.awakeFromNib() | |
constant /= UIScreen.main.scale | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment