diff --git a/PanModal/Presentable/PanModalPresentable+Defaults.swift b/PanModal/Presentable/PanModalPresentable+Defaults.swift index 3a76237..d282617 100644 --- a/PanModal/Presentable/PanModalPresentable+Defaults.swift +++ b/PanModal/Presentable/PanModalPresentable+Defaults.swift @@ -71,6 +71,10 @@ public extension PanModalPresentable where Self: UIViewController { return UIColor.black.withAlphaComponent(0.7) } + var dragIndicatorBackgroundColor: UIColor { + return UIColor.lightGray + } + var scrollIndicatorInsets: UIEdgeInsets { let top = shouldRoundTopCorners ? cornerRadius : 0 return UIEdgeInsets(top: CGFloat(top), left: 0, bottom: bottomLayoutOffset, right: 0) @@ -109,6 +113,10 @@ public extension PanModalPresentable where Self: UIViewController { return isPanModalPresented } + var showDragIndicator: Bool { + return shouldRoundTopCorners + } + func shouldRespond(to panModalGestureRecognizer: UIPanGestureRecognizer) -> Bool { return true } diff --git a/PanModal/View/ShadowConfigurator.swift b/PanModal/View/ShadowConfigurator.swift deleted file mode 100644 index c715a4f..0000000 --- a/PanModal/View/ShadowConfigurator.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) 2023 Touch Instinct -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the Software), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -import class UIKit.UIColor -import CoreGraphics - -public protocol ShadowConfigurator { - var radius: CGFloat { get set } - var offset: CGSize { get set } - var color: UIColor { get set } - var opacity: Float { get set } -} diff --git a/PanModal/View/UIView+ShadowConfigurator.swift b/PanModal/View/UIView+ShadowConfigurator.swift deleted file mode 100644 index b508657..0000000 --- a/PanModal/View/UIView+ShadowConfigurator.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) 2023 Touch Instinct -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the Software), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -import UIKit - -public extension UIView { - func configure(shadow: ShadowConfigurator) { - layer.shadowOpacity = shadow.opacity - layer.shadowOffset = shadow.offset - layer.shadowColor = shadow.color.cgColor - layer.shadowRadius = shadow.radius - clipsToBounds = false - } -}