или добавив
трю на некоторый код из библиотеки автоматического макета. В нем есть протокол, принятый UIView:
extension UIView: Constrainable {}
extension UILayoutGuide: Constrainable {
// LayoutGuide doesn't have baseline anchors, so just use the bottom anchor
public var firstBaselineAnchor: NSLayoutYAxisAnchor {
return bottomAnchor
}
public var lastBaselineAnchor: NSLayoutYAxisAnchor {
return bottomAnchor
}
}
public protocol Constrainable {
var topAnchor: NSLayoutYAxisAnchor { get }
var bottomAnchor: NSLayoutYAxisAnchor { get }
var leftAnchor: NSLayoutXAxisAnchor { get }
var rightAnchor: NSLayoutXAxisAnchor { get }
var leadingAnchor: NSLayoutXAxisAnchor { get }
var trailingAnchor: NSLayoutXAxisAnchor { get }
var centerXAnchor: NSLayoutXAxisAnchor { get }
var centerYAnchor: NSLayoutYAxisAnchor { get }
var widthAnchor: NSLayoutDimension { get }
var heightAnchor: NSLayoutDimension { get }
var firstBaselineAnchor : NSLayoutYAxisAnchor { get }
var lastBaselineAnchor : NSLayoutYAxisAnchor { get }
}
Что значит пустой{ get }
достичь?