OfTheWolf / UBottomSheet

iPhone Maps App bottom sheet - A Protocol Oriented Approach
MIT License
641 stars 68 forks source link

how to set the top hight of the bottomSheet? #54

Closed muhammadahmad665 closed 3 years ago

muhammadahmad665 commented 3 years ago

I want to set it close to the superView but it covers only on 80% of the screen. Help me here, please?

OfTheWolf commented 3 years ago

@MuhammadAhmad665

By default sheet min max positions were set to 0.2 to 0.7 of the superview height. So you should use custom data source instead. See custom data source example.

See UBottomSheetCoordinatorDataSource.swift#L38

///Default data source implementation
extension UBottomSheetCoordinatorDataSource {
    public func sheetPositions(_ availableHeight: CGFloat) -> [CGFloat] {
        return [0.2, 0.7].map { $0 * availableHeight }
    }