diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..ca45c29a --- /dev/null +++ b/Package.swift @@ -0,0 +1,22 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "PanModal", + platforms: [.iOS(.v10)], + products: [ + .library( + name: "PanModal", + targets: ["PanModal"]), + ], + dependencies: [], + targets: [ + .target( + name: "PanModal", + dependencies: [], + path: "PanModal") + ], + swiftLanguageVersions: [.version("4.2")] +) diff --git a/PanModal/Animator/PanModalAnimator.swift b/PanModal/Animator/PanModalAnimator.swift index 8cb2e711..712dd5d2 100644 --- a/PanModal/Animator/PanModalAnimator.swift +++ b/PanModal/Animator/PanModalAnimator.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -36,3 +37,4 @@ struct PanModalAnimator { completion: completion) } } +#endif diff --git a/PanModal/Animator/PanModalPresentationAnimator.swift b/PanModal/Animator/PanModalPresentationAnimator.swift index 28157297..f7fbdd0e 100644 --- a/PanModal/Animator/PanModalPresentationAnimator.swift +++ b/PanModal/Animator/PanModalPresentationAnimator.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -168,3 +169,4 @@ extension PanModalPresentationAnimator: UIViewControllerAnimatedTransitioning { } } +#endif diff --git a/PanModal/Controller/PanModalPresentationController.swift b/PanModal/Controller/PanModalPresentationController.swift index ca78b580..885b3d07 100644 --- a/PanModal/Controller/PanModalPresentationController.swift +++ b/PanModal/Controller/PanModalPresentationController.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -890,3 +891,4 @@ private extension UIScrollView { return isDragging && !isDecelerating || isTracking } } +#endif diff --git a/PanModal/Delegate/PanModalPresentationDelegate.swift b/PanModal/Delegate/PanModalPresentationDelegate.swift index b35fc3ec..24264b74 100644 --- a/PanModal/Delegate/PanModalPresentationDelegate.swift +++ b/PanModal/Delegate/PanModalPresentationDelegate.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -77,3 +78,4 @@ extension PanModalPresentationDelegate: UIAdaptivePresentationControllerDelegate } } +#endif diff --git a/PanModal/Presentable/PanModalHeight.swift b/PanModal/Presentable/PanModalHeight.swift index 547e633e..00654f4e 100644 --- a/PanModal/Presentable/PanModalHeight.swift +++ b/PanModal/Presentable/PanModalHeight.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -40,3 +41,4 @@ public enum PanModalHeight: Equatable { */ case intrinsicHeight } +#endif diff --git a/PanModal/Presentable/PanModalPresentable+Defaults.swift b/PanModal/Presentable/PanModalPresentable+Defaults.swift index 30b4a4d1..76a0679f 100644 --- a/PanModal/Presentable/PanModalPresentable+Defaults.swift +++ b/PanModal/Presentable/PanModalPresentable+Defaults.swift @@ -5,6 +5,7 @@ // Copyright © 2018 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -124,3 +125,4 @@ public extension PanModalPresentable where Self: UIViewController { } } +#endif diff --git a/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift b/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift index 49563b46..2437ffad 100644 --- a/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift +++ b/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift @@ -5,6 +5,7 @@ // Copyright © 2018 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -100,3 +101,4 @@ extension PanModalPresentable where Self: UIViewController { } } +#endif diff --git a/PanModal/Presentable/PanModalPresentable+UIViewController.swift b/PanModal/Presentable/PanModalPresentable+UIViewController.swift index a28997fa..8de82fd5 100644 --- a/PanModal/Presentable/PanModalPresentable+UIViewController.swift +++ b/PanModal/Presentable/PanModalPresentable+UIViewController.swift @@ -5,6 +5,7 @@ // Copyright © 2018 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -59,3 +60,4 @@ public extension PanModalPresentable where Self: UIViewController { } } +#endif diff --git a/PanModal/Presentable/PanModalPresentable.swift b/PanModal/Presentable/PanModalPresentable.swift index 032de094..76c15015 100644 --- a/PanModal/Presentable/PanModalPresentable.swift +++ b/PanModal/Presentable/PanModalPresentable.swift @@ -5,6 +5,7 @@ // Copyright © 2017 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -233,3 +234,4 @@ public protocol PanModalPresentable: AnyObject { */ func panModalDidDismiss() } +#endif diff --git a/PanModal/Presenter/PanModalPresenter.swift b/PanModal/Presenter/PanModalPresenter.swift index 9cbd876f..f27ba698 100644 --- a/PanModal/Presenter/PanModalPresenter.swift +++ b/PanModal/Presenter/PanModalPresenter.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -31,3 +32,4 @@ protocol PanModalPresenter: AnyObject { func presentPanModal(_ viewControllerToPresent: PanModalPresentable.LayoutType, sourceView: UIView?, sourceRect: CGRect) } +#endif diff --git a/PanModal/Presenter/UIViewController+PanModalPresenter.swift b/PanModal/Presenter/UIViewController+PanModalPresenter.swift index f663c506..48358c21 100644 --- a/PanModal/Presenter/UIViewController+PanModalPresenter.swift +++ b/PanModal/Presenter/UIViewController+PanModalPresenter.swift @@ -5,6 +5,7 @@ // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -58,3 +59,4 @@ extension UIViewController: PanModalPresenter { } } +#endif diff --git a/PanModal/View/DimmedView.swift b/PanModal/View/DimmedView.swift index dea26374..6fdd1d8b 100644 --- a/PanModal/View/DimmedView.swift +++ b/PanModal/View/DimmedView.swift @@ -5,6 +5,7 @@ // Copyright © 2017 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -72,3 +73,4 @@ public class DimmedView: UIView { } } +#endif diff --git a/PanModal/View/PanContainerView.swift b/PanModal/View/PanContainerView.swift index a52d8148..f5c2892b 100644 --- a/PanModal/View/PanContainerView.swift +++ b/PanModal/View/PanContainerView.swift @@ -5,6 +5,7 @@ // Copyright © 2018 Tiny Speck, Inc. All rights reserved. // +#if os(iOS) import UIKit /** @@ -40,3 +41,4 @@ extension UIView { } } +#endif