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
With Xcode 6 and introduction of @IBInspectable and @IBDesignable keywords it is definitely possible and rather simple. No need to subclass/outlet anything.
You can do an extension (category) for NSLayoutConstraint with following code (swift):
extension NSLayoutConstraint {
@IBInspectable var preciseConstant: Int {
get {
return Int(constant * UIScreen.mainScreen().scale)
}
set {
constant = CGFloat(newValue) / UIScreen.mainScreen().scale
}
}
}
Then you can choose needed constraint in your IB.

Go to its properties and set the value.

In above case it will render a view with 1 px height on 1x, 2x and 3x devices.