     override func viewDidLoad() {
       super.viewDidLoad()
 
-      view.snp.setLabel("bar")
+      // TODO: Figure out how to do this dynamically. Ideally we would get these from the margins
+      // of the content view controller, but they're not what we want.
+      view.layoutMargins = Metrics.Bar.defaultMargins
+      // Ignore system mimimums because we want to use our custom margins.
+      viewRespectsSystemMinimumLayoutMargins = false
+      // Inset the layout margins from the edge, so we can keep the bar as close to the edge as
+      // possible.
+      view.insetsLayoutMarginsFromSafeArea = false
+      view.snp.setLabel("root")
 
       content.view.snp.setLabel("content")
       addChild(content)

        make.edges.equalToSuperview()
      }

      barWrapper.snp.setLabel("barWrapper")
      view.addSubview(barWrapper)
      barWrapper.snp.makeConstraints { make in
        make.leading.bottom.equalToSuperview()
        make.trailing.greaterThanOrEqualToSuperview()
      }

      configure(bar: bar)

      // TODO: Figure out how to do this dynamically. Ideally we would get these from the margins
      // of the content view controller, but they're not what we want.
      barWrapper.safeMargins = Metrics.Bar.defaultMargins
    }

    private func configure(bar: Bar) {
      bar.snp.setLabel("bar")
      barWrapper.contentView.addSubview(bar)
      bar.snp.makeConstraints { make in
        make.edges.equalToSuperview()
      }
    }

    override func viewDidLayoutSubviews() {
      super.viewDidLayoutSubviews()

      // Lowering and raising the bar uses a `transform` based on a subview height, so we need to
      // update the transform after layout changes because the height may have changed.
      updatePosition()
    }


    private func updatePosition() {
      switch position {
      case .lowered:
        bar.transform = CGAffineTransform(translationX: 0, y: bar.bounds.height)
      case .raised:
        bar.transform = .identity
      }
      updateAdditionalSafeAreaInsets()
    }

    private func updateAdditionalSafeAreaInsets() {
      if position == .raised, bar.alpha > 0 {
        content.additionalSafeAreaInsets =
          UIEdgeInsets(top: 0, left: 0, bottom: bar.bounds.height, right: 0)
      } else {
        content.additionalSafeAreaInsets = .zero
      }
