|
@@ -63,7 +63,7 @@ open class KSMediaPickerView: UIView {
|
|
|
}
|
|
|
collectionView.scrollViewDidEndDraggingCallback = {[weak self] (scrollView, decelerate) in
|
|
|
self?._collectionViewDidEndDragging(scrollView, decelerate: decelerate)
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override open func layoutSublayers(of layer: CALayer) {
|
|
@@ -159,25 +159,26 @@ open class KSMediaPickerView: UIView {
|
|
|
_panBeginLocationY = pan.location(in: self).y
|
|
|
break
|
|
|
case .changed:
|
|
|
- guard let baseY = _baseY else {
|
|
|
- return
|
|
|
- }
|
|
|
- let location = pan.location(in: self)
|
|
|
- let locationY = location.y
|
|
|
- _isScrollDown = locationY > _panBeginLocationY
|
|
|
- _isInGestureCorrespondingArea = _previewGestureCorrespondingArea != nil && _previewGestureCorrespondingArea!.contains(location)
|
|
|
- if _isInGestureCorrespondingArea {
|
|
|
- var previewFrame = previewView.frame
|
|
|
- var y = locationY-previewFrame.size.height
|
|
|
- if y >= baseY {
|
|
|
- y = baseY
|
|
|
- }
|
|
|
- previewFrame.origin.y = y
|
|
|
- previewView.frame = previewFrame
|
|
|
-
|
|
|
- _previewGestureCorrespondingArea!.size.height = previewFrame.maxY+20.0
|
|
|
- }
|
|
|
- _panBeginLocationY = locationY
|
|
|
+ // preview视图收起展示逻辑
|
|
|
+// guard let baseY = _baseY else {
|
|
|
+// return
|
|
|
+// }
|
|
|
+// let location = pan.location(in: self)
|
|
|
+// let locationY = location.y
|
|
|
+// _isScrollDown = locationY > _panBeginLocationY
|
|
|
+// _isInGestureCorrespondingArea = _previewGestureCorrespondingArea != nil && _previewGestureCorrespondingArea!.contains(location)
|
|
|
+// if _isInGestureCorrespondingArea {
|
|
|
+// var previewFrame = previewView.frame
|
|
|
+// var y = locationY-previewFrame.size.height
|
|
|
+// if y >= baseY {
|
|
|
+// y = baseY
|
|
|
+// }
|
|
|
+// previewFrame.origin.y = y
|
|
|
+// previewView.frame = previewFrame
|
|
|
+//
|
|
|
+// _previewGestureCorrespondingArea!.size.height = previewFrame.maxY+20.0
|
|
|
+// }
|
|
|
+// _panBeginLocationY = locationY
|
|
|
break
|
|
|
case .cancelled, .ended, .failed:
|
|
|
guard _isInGestureCorrespondingArea, let baseY = _baseY else {
|