Merge pull request #49 from pvieito/master

[Package] Added SwiftPM support and added fix to ensure the currentHandle exists before first interaction
This commit is contained in:
Jonathan Cardasis 2020-06-04 15:30:59 -04:00 committed by GitHub
commit 4fa7a0b3cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

27
Package.swift Normal file
View File

@ -0,0 +1,27 @@
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "ChromaColorPicker",
platforms: [
.iOS(.v10)
],
products: [
.library(
name: "ChromaColorPicker",
targets: ["ChromaColorPicker"]
)
],
targets: [
.target(
name: "ChromaColorPicker",
path: "Source"
),
.testTarget(
name: "ChromaColorPickerTests",
dependencies: ["ChromaColorPicker"],
path: "Tests"
)
]
)

View File

@ -91,6 +91,10 @@ public class ChromaColorPicker: UIControl, ChromaControlStylable {
handles.append(handle)
colorWheelView.addSubview(handle)
brightnessSlider?.trackColor = handle.color
if currentHandle == nil {
currentHandle = handle
}
}
public func connect(_ slider: ChromaBrightnessSlider) {