How can a variable of type NSLayoutYAxisAnchor
be defined?
The following doesnt work, but hopefully illustrates what I mean:
let anAnchor: NSLayoutYAxisAnchor = .topAnchor
NSLayoutConstraints.activate([
viewA.anAnchor.constraint(equalTo: viewB.anAnchor)
])
You can do this with the new key path feature of Swift 4: