For example:
<img width="1904" alt="Screen Shot 2021-11-05 at 11 59 05 AM" src="https://user-images.githubusercontent.com/29597/140540816-25d6d47b-7aea-4121-aeaa-565accc65b1f.png">

if (this._needsDisplay) {
      this.layoutSubviews();
    }
    const frames = this.subviews.map(subview => subview.frame);
    return unionOfRects(...frames).size;
  }
  /**
   * Appends `view` to the list of this view's `subviews`.
   */
  addSubview(view: View) {
    if (this.subviews.includes(view)) {
      return;
    }
    this.subviews.push(view);
    view.superview = this;
  }
  /**
   * Breaks the subview-superview relationship between `view` and this view, if
   * `view` is a subview of this view.
   */
  removeSubview(view: View) {
    const subviewIndex = this.subviews.indexOf(view);
    if (subviewIndex === -1) {
      return;
    }
    view.superview = undefined;
    this.subviews.splice(subviewIndex, 1);
  }
  /**
   * Removes all subviews from this view.