**The Problem**  

I have subclassed a `UITextView` and added a `UILabel` as a subview. I want to position the label in the bottom right hand corner.

**Code**

```
  fileprivate lazy var counterLabel: UILabel = {
    let label = UILabel()
    label.translatesAutoresizingMaskIntoConstraints = false

    self.addSubview(label)

    // add constraints
    self.addConstraints([
      NSLayoutConstraint(item: label, equalTo: self, attribute: .right),
      NSLayoutConstraint(item: label, equalTo: self, attribute: .bottom)]
    )

    return label
  }()

```

**Screenshot**  

![enter image description here](https://i.stack.imgur.com/nyufe.png)

As seen in the above screenshot, the red label is shown to have an `ambiguous layout`

If I use a storyboard, and add the same two constraints (bottom, right) the label does not have an ambiguous position. What have I done wrong?