Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mortenbekditlevsen/3ac2a21896dd775b0bb4410becd2e403 to your computer and use it in GitHub Desktop.
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
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