Savva-Shuliatev / DynamicBottomSheet

A highly customizable dynamic bottom sheet component for iOS built using UIKit.
Other
6 stars 1 forks source link

Add concentration on the retainer during the change of bounds #7

Open Savva-Shuliatev opened 1 week ago

Savva-Shuliatev commented 1 week ago

When the window size changes, the constraint remains static, which makes it difficult to achieve some custom behavior. If it were possible to focus on a point during the change of boundaries via the API, new possibilities could be achieved.

However, it is not obvious what to do if the change of boundaries occurs during the animation, stop it?

Savva-Shuliatev commented 1 week ago

Yea, it is possible, mb will update this code logic:

    if lastViewGeometry != ViewGeometry(of: self) {
      lastViewGeometry = ViewGeometry(of: self)

      anchors = detents.positions.map { detents.y(for: $0) }
      updateCornerRadius()
      updateViewHeight()
      updateViewTopAnchor()
      updateBottomBarAreaHeight()
    }