diff --git a/.gitignore b/.gitignore index 8f68502..dad3ec3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ xcuserdata # Carthage Carthage/Build + +# SwiftPM +.build diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..a9a6cdb --- /dev/null +++ b/Package.swift @@ -0,0 +1,18 @@ +// swift-tools-version:5.2 + +import PackageDescription + +let package = Package( + name: "Permission", + platforms: [ + .iOS(.v10) + ], + products: [ + .library(name: "Permission", targets: ["Permission"]) + ], + targets: [ + .target(name: "Permission", path: "Source"), + .testTarget(name: "PermissionTests", dependencies: ["Permission"], path: "Tests") + ] +) + diff --git a/Source/Permission.swift b/Source/Permission.swift index 6cf36c0..2800c1d 100644 --- a/Source/Permission.swift +++ b/Source/Permission.swift @@ -22,6 +22,8 @@ // SOFTWARE. // +import Foundation + open class Permission: NSObject { public typealias Callback = (PermissionStatus) -> Void diff --git a/Source/PermissionAlert.swift b/Source/PermissionAlert.swift index 6a9904c..d860166 100644 --- a/Source/PermissionAlert.swift +++ b/Source/PermissionAlert.swift @@ -22,6 +22,10 @@ // SOFTWARE. // +#if canImport(UIKit) +import UIKit +#endif + open class PermissionAlert { /// The permission. fileprivate let permission: Permission diff --git a/Source/PermissionButton.swift b/Source/PermissionButton.swift index e6eea9a..fc09101 100644 --- a/Source/PermissionButton.swift +++ b/Source/PermissionButton.swift @@ -22,6 +22,10 @@ // SOFTWARE. // +#if canImport(UIKit) +import UIKit +#endif + open class PermissionButton: UIButton { /// The permission of the button. diff --git a/Source/Supporting Files/Utilities.swift b/Source/Supporting Files/Utilities.swift index 6dc00e5..86484db 100644 --- a/Source/Supporting Files/Utilities.swift +++ b/Source/Supporting Files/Utilities.swift @@ -22,6 +22,10 @@ // SOFTWARE. // +#if canImport(UIKit) +import UIKit +#endif + extension UIApplication { private var topViewController: UIViewController? { var vc = keyWindow?.rootViewController