Skip to content

Commit

Permalink
Merge pull request #8 from finn-no/fix/reset-method
Browse files Browse the repository at this point in the history
Reset method animates to max height instead of offset
  • Loading branch information
shredlocker authored Nov 27, 2019
2 parents 042efd8 + e5f9e9e commit 93c93af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
shell: /bin/bash --login -o pipefail
steps:
- checkout
- run: xcodebuild -project BottomSheet.xcodeproj -scheme "Demo" -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.2.2,name=iPhone 11 Pro' build test | xcpretty
- run: xcodebuild -project BottomSheet.xcodeproj -scheme "Demo" -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.3,name=iPhone 11 Pro' build test | xcpretty

swiftlint:
docker:
Expand All @@ -20,4 +20,4 @@ workflows:
build-and-test:
jobs:
- swiftlint
- build-and-test
- build-and-test
7 changes: 1 addition & 6 deletions Sources/BottomSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,7 @@ public final class BottomSheetView: UIView {
/// Call this method e.g. when orientation change is detected.
public func reset() {
updateTargetOffsets()

guard let maxOffset = targetHeights.max() else {
return
}

animate(to: maxOffset)
animate(to: targetOffsets[currentTargetOffsetIndex])
}

/// Animates bottom sheet view to the given height.
Expand Down

0 comments on commit 93c93af

Please sign in to comment.