When I was using Anchorage for the first time, I was trying to anchor a label within a UIViewController. I didn't realize the "container" in the docs was in specific reference to the view, so I first did
label.centerAnchors == self.centerAnchors
(instead of label.centerAnchors == self.view.centerAnchors)
which actually worked, adding to my confusion. I realized the issue when I tried to access the UIViewController's leading and trailing anchors, which of course it has none. However, it does have center, edge, size, vertical, and horizontal anchors, which led me in the wrong direction.
When I was using Anchorage for the first time, I was trying to anchor a label within a UIViewController. I didn't realize the "container" in the docs was in specific reference to the view, so I first did
label.centerAnchors == self.centerAnchors
(instead oflabel.centerAnchors == self.view.centerAnchors
) which actually worked, adding to my confusion. I realized the issue when I tried to access the UIViewController's leading and trailing anchors, which of course it has none. However, it does have center, edge, size, vertical, and horizontal anchors, which led me in the wrong direction.