[Package] Added SwiftPM support and added fix to ensure the currentHandle exists event when no touch has started

The fix is required to ensure the that the brightness control works when is touched before the wheel.
This commit is contained in:
Pedro José Pereira Vieito 2020-04-13 16:50:17 +02:00
parent a67e079958
commit ce9b95782b
2 changed files with 31 additions and 0 deletions

27
Package.swift Normal file
View File

@ -0,0 +1,27 @@
// swift-tools-version:5.2
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) {