Documentation nits.
This commit is contained in:
parent
5baac6732e
commit
d70dce231f
|
|
@ -550,7 +550,7 @@ private extension PanModalPresentationController {
|
|||
Allow api consumers to override the internal conditions &
|
||||
decide if the pan gesture recognizer should be prioritized.
|
||||
|
||||
⚠️ This is the only time we should be cancelling a recognizer,
|
||||
⚠️ This is the only time we should be cancelling the panScrollable recognizer,
|
||||
for the purpose of ensuring we're no longer tracking the scrollView
|
||||
*/
|
||||
guard !shouldPrioritize(panGestureRecognizer: panGestureRecognizer) else {
|
||||
|
|
@ -577,7 +577,7 @@ private extension PanModalPresentationController {
|
|||
*/
|
||||
func shouldPrioritize(panGestureRecognizer: UIPanGestureRecognizer) -> Bool {
|
||||
return panGestureRecognizer.state == .began &&
|
||||
presentable?.shouldPrioritize(panModalGestureRecognizer: panGestureRecognizer) ?? false
|
||||
presentable?.shouldPrioritize(panModalGestureRecognizer: panGestureRecognizer) == true
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// PanModalHeight.swift
|
||||
// SlackUI
|
||||
// PanModal
|
||||
//
|
||||
// Copyright © 2019 Tiny Speck, Inc. All rights reserved.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// PanModalPresentable+Defaults.swift
|
||||
// PanModal
|
||||
//
|
||||
// Created by Stephen Sowole on 11/5/18.
|
||||
// Copyright © 2018 Tiny Speck, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
|
|
@ -31,6 +30,10 @@ public extension PanModalPresentable where Self: UIViewController {
|
|||
return .contentHeight(scrollView.contentSize.height)
|
||||
}
|
||||
|
||||
var cornerRadius: CGFloat {
|
||||
return 8.0
|
||||
}
|
||||
|
||||
var springDamping: CGFloat {
|
||||
return 0.8
|
||||
}
|
||||
|
|
@ -77,10 +80,6 @@ public extension PanModalPresentable where Self: UIViewController {
|
|||
return isPanModalPresented
|
||||
}
|
||||
|
||||
var cornerRadius: CGFloat {
|
||||
return 8.0
|
||||
}
|
||||
|
||||
var showDragIndicator: Bool {
|
||||
return shouldRoundTopCorners
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import UIKit
|
|||
|
||||
Usage:
|
||||
```
|
||||
extension UIViewController: PanModalPresentable {
|
||||
extension YourViewController: PanModalPresentable {
|
||||
func shouldRoundTopCorners: Bool { return false }
|
||||
}
|
||||
```
|
||||
|
|
@ -54,6 +54,13 @@ public protocol PanModalPresentable {
|
|||
*/
|
||||
var longFormHeight: PanModalHeight { get }
|
||||
|
||||
/**
|
||||
The corner radius used when `shouldRoundTopCorners` is enabled.
|
||||
|
||||
Default Value is 8.0.
|
||||
*/
|
||||
var cornerRadius: CGFloat { get }
|
||||
|
||||
/**
|
||||
The springDamping value used to determine the amount of 'bounce'
|
||||
seen when transitioning to short/long form.
|
||||
|
|
@ -91,13 +98,13 @@ public protocol PanModalPresentable {
|
|||
A flag to determine if scrolling should seamlessly transition from the pan modal container view to
|
||||
the embedded scroll view once the scroll limit has been reached.
|
||||
|
||||
Default value is false.
|
||||
Unless a scrollView is provided and the content exceeds the longForm height
|
||||
Default value is false. Unless a scrollView is provided and the content height exceeds the longForm height.
|
||||
*/
|
||||
var allowsExtendedPanScrolling: Bool { get }
|
||||
|
||||
/**
|
||||
A flag to determine if dismissal should be initiated when swiping down on the presented view.
|
||||
|
||||
Return false to fallback to the short form state instead of dismissing.
|
||||
|
||||
Default value is true.
|
||||
|
|
@ -137,13 +144,6 @@ public protocol PanModalPresentable {
|
|||
*/
|
||||
var shouldRoundTopCorners: Bool { get }
|
||||
|
||||
/**
|
||||
The corner radius used when `shouldRoundTopCorners` is enabled.
|
||||
|
||||
Default Value is 8.0.
|
||||
*/
|
||||
var cornerRadius: CGFloat { get }
|
||||
|
||||
/**
|
||||
A flag to determine if a drag indicator should be shown
|
||||
above the pan modal container view.
|
||||
|
|
@ -161,7 +161,7 @@ public protocol PanModalPresentable {
|
|||
|
||||
Default value is an empty implementation.
|
||||
*/
|
||||
func willRespond(to panGestureRecognizer: UIPanGestureRecognizer)
|
||||
func willRespond(to panModalGestureRecognizer: UIPanGestureRecognizer)
|
||||
|
||||
/**
|
||||
Asks the delegate if the pan modal gesture recognizer should be prioritized.
|
||||
|
|
@ -169,8 +169,8 @@ public protocol PanModalPresentable {
|
|||
For example, you can use this to define a region
|
||||
where you would like to restrict where the pan gesture can start.
|
||||
|
||||
If false, then we rely on the internal conditions of when a pan gesture
|
||||
should succeed or fail, such as, if we're actively scrolling on the scrollView
|
||||
If false, then we rely solely on the internal conditions of when a pan gesture
|
||||
should succeed or fail, such as, if we're actively scrolling on the scrollView.
|
||||
|
||||
Default return value is false.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// PanModalPresenter.swift
|
||||
// SlackUI
|
||||
// PanModal
|
||||
//
|
||||
// Copyright © 2019 Tiny Speck, Inc. All rights reserved.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// UIViewController+PanModalPresenterProtocol.swift
|
||||
// SlackUI
|
||||
// PanModal
|
||||
//
|
||||
// Copyright © 2019 Tiny Speck, Inc. All rights reserved.
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue