Note, I\'m looking to make a 1px line, not a 1pt line. Meaning it should be 1px regardless of screen scale (so 0.5pt on Retina devices).
I can do this programmatica
I created NSLayoutConstraint subclass:
class HairlineConstraint: NSLayoutConstraint {
override func awakeFromNib() {
super.awakeFromNib()
self.constant = 1.0 / UIScreen.main.scale
}
}
Then simply create your view in interface builder, add height constraint
and set its class to HairlineConstraint.
Done.