Skip to content

Commit

Permalink
Renamed to ColorPickerRing to avoid collision with iOS 14 ColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
Qandelor committed Aug 11, 2020
1 parent e2e3737 commit 362bfaf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/.build
/Packages
/*.xcodeproj
.swiftpm/xcode/package.xcworkspace/xcuserdata
.swiftpm/xcode/xcuserdata
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import PackageDescription

let package = Package(
name: "ColorPicker",
name: "ColorPickerRing",
platforms: [
.macOS(SupportedPlatform.MacOSVersion.v10_15),
.iOS(SupportedPlatform.IOSVersion.v13)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "ColorPicker",
targets: ["ColorPicker"]),
name: "ColorPickerRing",
targets: ["ColorPickerRing"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -24,7 +24,7 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "ColorPicker",
name: "ColorPickerRing",
dependencies: ["DynamicColor"]),
]
)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ColorPicker
# ColorPickerRing

A color picker implementation with color wheel appearance written in plain SwiftUI. It is compatible with UIColor and NSColor.

Expand All @@ -8,18 +8,18 @@ A color picker implementation with color wheel appearance written in plain Swift

Add this repository as a Swift Package Dependency to your project. You find the option in Xcode unter "File > Swift Packages > Add Package Dependency...". Paste the HTTPS reference to this repo and you're done!

After importing the module: Simply use the `ColorPicker` structure which is a regular SwiftUI `View`.
After importing the module: Simply use the `ColorPickerRing` structure which is a regular SwiftUI `View`.
This project uses the [DynamicColor](https://github.com/yannickl/DynamicColor) dependency which lets you write plattform independant color classes. No matter if iOS or macOS. Internally it uses `UIColor` and `NSColor`.

```
import SwiftUI
import ColorPicker
import ColorPickerRing
struct ContentView: View {
@State var color = UIColor.red
var body: some View {
ColorPicker(color: $color, strokeWidth: 30)
ColorPickerRing(color: $color, strokeWidth: 30)
.frame(width: 300, height: 300, alignment: .center)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ColorExtension.swift
// ColorPicker
// ColorPickerRing
//
// Created by Hendrik Ulbrich on 16.07.19.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ColorPicker.swift
// ColorPicker
// ColorPickerRing.swift
// ColorPickerRing
//
// Created by Hendrik Ulbrich on 15.07.19.
//
Expand All @@ -12,7 +12,7 @@
import SwiftUI
import DynamicColor

public struct ColorPicker : View {
public struct ColorPickerRing : View {
public var color: Binding<DynamicColor>
public var strokeWidth: CGFloat = 30

Expand Down

0 comments on commit 362bfaf

Please sign in to comment.