So I'm trying to add constraints programmatically:
I'm simply adding two constraints and Xcode has started to show me:
centerXAnchor is only available in iOS 9.0 or newer
Here is my code:
var constraints = [NSLayoutConstraint]()
let centerImageX = imageView.centerXAnchor.constraint(equalTo: footerView.centerXAnchor)
let centerImageY = imageView.centerYAnchor.constraint(equalTo: footerView.centerYAnchor)
constraints = [centerImageX,centerImageY]
NSLayoutConstraint.activate(constraints)
One thing which I want to share is probably unbelievable that couple of days back I wasn't getting any error message.
My Xcode version is 8.2.1
.
Also my deployment target is 8.0
and above. So, if anyone could tell me or can convert or translate the same code for iOS 8.0 that would be awesome!