diff --git a/ColorPicker.xcodeproj/project.pbxproj b/ColorPicker.xcodeproj/project.pbxproj index 005b3cf..c1f3446 100644 --- a/ColorPicker.xcodeproj/project.pbxproj +++ b/ColorPicker.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4A17F36E23B7E58700619791 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A17F36D23B7E58700619791 /* Package.swift */; }; 9668C54C217AE63C0021FC09 /* ColorSpaceConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9668C54B217AE63C0021FC09 /* ColorSpaceConverter.swift */; }; 9668C54E217B0DCD0021FC09 /* ColorPickerViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9668C54D217B0DCD0021FC09 /* ColorPickerViewDelegate.swift */; }; 9668C550217B29BF0021FC09 /* UIColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9668C54F217B29BF0021FC09 /* UIColorExtension.swift */; }; @@ -29,6 +30,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 4A17F36D23B7E58700619791 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; }; 9668C54B217AE63C0021FC09 /* ColorSpaceConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorSpaceConverter.swift; sourceTree = ""; }; 9668C54D217B0DCD0021FC09 /* ColorPickerViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPickerViewDelegate.swift; sourceTree = ""; }; 9668C54F217B29BF0021FC09 /* UIColorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtension.swift; sourceTree = ""; }; @@ -65,6 +67,7 @@ 966E577A217A0A2B009CBABF = { isa = PBXGroup; children = ( + 4A17F36D23B7E58700619791 /* Package.swift */, 966E5786217A0A2B009CBABF /* ColorPicker */, 966E5791217A0A2C009CBABF /* ColorPickerTests */, 966E5785217A0A2B009CBABF /* Products */, @@ -216,6 +219,7 @@ 966E57C8217A1437009CBABF /* ColorPickerView.swift in Sources */, 966E57C1217A12EC009CBABF /* RGB.swift in Sources */, 9668C54E217B0DCD0021FC09 /* ColorPickerViewDelegate.swift in Sources */, + 4A17F36E23B7E58700619791 /* Package.swift in Sources */, 966E57C3217A12F3009CBABF /* HSB.swift in Sources */, 9668C54C217AE63C0021FC09 /* ColorSpaceConverter.swift in Sources */, 9668C550217B29BF0021FC09 /* UIColorExtension.swift in Sources */, diff --git a/ColorPicker/ColorPickerView.swift b/ColorPicker/ColorPickerView.swift index c15707b..b16baf9 100644 --- a/ColorPicker/ColorPickerView.swift +++ b/ColorPicker/ColorPickerView.swift @@ -6,7 +6,7 @@ // Copyright © 2018年 culumn. All rights reserved. // -import Foundation +import UIKit public class ColorPickerView: UIView { diff --git a/ColorPicker/ColorPickerViewDelegate.swift b/ColorPicker/ColorPickerViewDelegate.swift index df6116a..9fb59ad 100644 --- a/ColorPicker/ColorPickerViewDelegate.swift +++ b/ColorPicker/ColorPickerViewDelegate.swift @@ -6,8 +6,6 @@ // Copyright © 2018年 culumn. All rights reserved. // -import Foundation - public protocol ColorPickerViewDelegate: class { func colorPickerWillBeginDragging(_ colorPicker: ColorPickerView) func colorPickerDidSelectColor(_ colorPicker: ColorPickerView) diff --git a/ColorPicker/HSB.swift b/ColorPicker/HSB.swift index 611a51d..0687aff 100644 --- a/ColorPicker/HSB.swift +++ b/ColorPicker/HSB.swift @@ -6,7 +6,7 @@ // Copyright © 2018年 culumn. All rights reserved. // -import Foundation +import UIKit public struct HSB { public var hue: CGFloat diff --git a/ColorPicker/RGB.swift b/ColorPicker/RGB.swift index 254d275..301fd98 100644 --- a/ColorPicker/RGB.swift +++ b/ColorPicker/RGB.swift @@ -6,7 +6,7 @@ // Copyright © 2018年 culumn. All rights reserved. // -import Foundation +import UIKit public struct RGB { public var red: CGFloat diff --git a/ColorPicker/UIColorExtension.swift b/ColorPicker/UIColorExtension.swift index 28943cd..1e5d8c0 100644 --- a/ColorPicker/UIColorExtension.swift +++ b/ColorPicker/UIColorExtension.swift @@ -6,7 +6,7 @@ // Copyright © 2018年 culumn. All rights reserved. // -import Foundation +import UIKit public extension UIColor { diff --git a/ColorPickerTests/Info.plist b/ColorPickerTests/info.plist similarity index 98% rename from ColorPickerTests/Info.plist rename to ColorPickerTests/info.plist index 6c40a6c..2d98bea 100644 --- a/ColorPickerTests/Info.plist +++ b/ColorPickerTests/info.plist @@ -19,4 +19,4 @@ CFBundleVersion 1 - + \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..7fbf345 --- /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: "ColorPicker", + platforms: [ + .iOS(.v9) + ], + products: [ + .library( + name: "ColorPicker", + targets: ["ColorPicker"]), + ], + targets: [ + .target( + name: "ColorPicker", + path: "ColorPicker/") + ] +) + diff --git a/README.md b/README.md index 9e2c350..a2412cb 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,13 @@ class ViewController: UIViewController, ColorPickerViewDelegate { To run the example project, open the `Example/Example.xcworkspace`. ## Installation + +### Swift Package Manager +In Xcode 11+, Go to File > Swift Packages > Add Package Dependencies… and paste the following Git URL into the text box: +``` +https://github.com/culumn/ColorPicker +``` + ### [CocoaPods](https://cocoapods.org) ColorPicker is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your `Podfile`: