Skip to content

Commit

Permalink
Feature/cocoapods (#7)
Browse files Browse the repository at this point in the history
* Update README.md

* added xcodeproj and podspec

* modified specs and validation is proper now

* updated version of pod
  • Loading branch information
ThasianX authored Aug 3, 2020
1 parent e4ae44e commit f27bd73
Show file tree
Hide file tree
Showing 8 changed files with 551 additions and 5 deletions.
22 changes: 22 additions & 0 deletions ElegantColorPalette.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Pod::Spec.new do |s|
s.name = 'ElegantColorPalette'
s.version = '1.0.0'
s.summary = 'The elegant color picker missed in UIKit and SwiftUI'

s.description = <<-DESC
`ElegantColorPalette` is inspired by [TimePage](https://us.moleskine.com/timepage/p0486) and is part of a larger repository of elegant demonstrations like this: [TimePage Clone](https://github.com/ThasianX/TimePage-Clone).
The top level view is an `SKView` that presents an `SKScene` of colors nodes. The color nodes are `SKShapeNode` subclasses. When using this library, you are only interacting with the `SKView`: all you have to do is configure the size of the view either through autolayout or size constraints and the view does the rest.
DESC

s.homepage = 'https://github.com/ThasianX/ElegantColorPalette'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Kevin Li' => '[email protected]' }
s.source = { :git => 'https://github.com/ThasianX/ElegantColorPalette.git', :tag => s.version.to_s }

s.ios.deployment_target = '13.0'
s.swift_version = '5.1'

s.source_files = 'Sources/**/*.swift'

end
414 changes: 414 additions & 0 deletions ElegantColorPalette.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<false/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ElegantColorPalette::ElegantColorPalette"
BuildableName = "ElegantColorPalette.framework"
BlueprintName = "ElegantColorPalette"
ReferencedContainer = "container:ElegantColorPalette.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

The elegant color picker missed in UIKit and SwiftUI.

<img src="https://github.com/ThasianX/GIFs/blob/master/ElegantColorPicker/demo.gif" width="300"/>
<img src="https://github.com/ThasianX/GIFs/blob/master/ElegantColorPalette/demo.gif" width="320"/>

This example GIF is from [ElegantTimeline](https://github.com/ThasianX/ElegantTimeline-SwiftUI). For a simpler demonstration, you can look at either of the 3 demo projects in this repository.

- [Introduction](#introduction)
- [Basic Usage](#basic-usage)
Expand All @@ -23,6 +25,8 @@ The elegant color picker missed in UIKit and SwiftUI.

`ElegantColorPalette` is inspired by [TimePage](https://us.moleskine.com/timepage/p0486) and is part of a larger repository of elegant demonstrations like this: [TimePage Clone](https://github.com/ThasianX/TimePage-Clone).

The top level view is an `SKView` that presents an `SKScene` of colors nodes. The color nodes are `SKShapeNode` subclasses. When using this library, you are only interacting with the `SKView`: all you have to do is configure the size of the view either through autolayout or size constraints and the view does the rest.

## Basic usage

For SwiftUI:
Expand All @@ -36,7 +40,7 @@ struct ExampleSwiftUIView: View {
@State private var selectedColor: PaletteColor = .kiwiGreen

var body: some View {
ColorPaletteDynamicView(colors: PaletteColor.allColors, selectedColor: $selectedColor)
ColorPaletteBindingView(selectedColor: $selectedColor, colors: PaletteColor.allColors)
}

}
Expand Down Expand Up @@ -94,9 +98,8 @@ struct ExampleUIKitViewController: UIViewController {

...

paletteView.update(withColors: PaletteColor.allColors)

paletteView
.update(withColors: PaletteColor.allColors)
.didSelectColor { [unowned self] color in
...
}
Expand All @@ -111,7 +114,7 @@ Documentation coming soon...

## Demos

There are 3 different demos, covering UIKit storyboards, XIBs, programmatic instantiation, and SwiftUI.
There are 3 different demos, covering UIKit storyboards, XIBs and programmatic instantiation, and SwiftUI.

## Installation

Expand Down
26 changes: 26 additions & 0 deletions Sources/ElegantColorPalette/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

0 comments on commit f27bd73

Please sign in to comment.