desiredSize() {
    if (this._needsDisplay) {
      this.layoutSubviews();
    }

    const frames = this.subviews.map(subview => subview.frame);
    return unionOfRects(...frames).size;
  }
A size that can be used as a hint by layout functions.

Implementations should typically return the intrinsic content size or a
size that fits all the view's content.

The default implementation returns a size that fits all the view's
subviews.

Can be overridden by subclasses.