In storyboard have a UIView, with a constraint for example \"0.1\" proportional height.
Imagine you have a similar constraint \"0.1\", on views in many different sce
I tried to find something similar when i started developing using Storyboard and Interface Builder. Unfortunately, xCode is not so scalable and code centralization using Interface Builder can't be implemented easily as can be done in Android development for example.
You could try something like this, use custom @IBDesignable attribute in UIView extension and change constraints values or adding constraint at runtime (but i don't know if it will affect Interface Builder too):
extension UIView {
@IBInspectable var insertTopConstraint: Bool {
set {
// suppose 10 is your fixed value
addConstraint(NSLayoutConstraint(item: self, attribute: .Top, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: 10))
updateConstraintsIfNeeded() // could be useful..
}
get {
return true
}
}
}
It could be a starting point. Hope it helps