Comments (4)
Sorry, but I believe that the demo is as concise as it gets. If you are not willing to invest 30 minutes into going trough the Demo project than I cannot help you to make it any faster anyway.
However, I will give some guidance - read the appropriate section in the README and when studing the demo only focus on e.g. PickerInTabelDemoController. All the magic happens in the storyboard in the demo but all can be done with code as well.
Another approach would be to read the in-code documentation starting from ColorPickerController
. Basically, all you need to do is to add ColorControls
that you need to its colorControls
property and then lay them out on the screen using autolayout.
Btw. I am planning on improving the documentation on custom color pickers but I might only get to it in September.
from flexcolorpicker.
Thanks for answer! You'r absolutely right. Actually I've figured out how to implement ColorPicker in Storyboard by your demo project. But unfortunately i didn't understand how to implement extra properties for the custom view by code. Anyway thank you for that.
Btw. I think some think wrong with my demo project. I have some error with debug file.
And also one ViewController lost RadialHueControl. I just download demo project and run. Do I need to do some think else?
And one extra question.
In CustomColorPickerViewController.swift file in function viewDidLoad() I tried to change UI background color. But after some tests my changes not affect on UI. It's always .systemBackground Is it right place for change that parameter? I understand, that viewDidLoad() never called even CustomView appear on the screen.
from flexcolorpicker.
Hi. I've founded some answer on my questions. May be for someone it will be useful.
-
viewDidLoad() I understood why this method have not worked. I don't know why, but when I run project the builder compiles CustomColorPickerViewController.swift only once. After first run, builder don't recompile this file again, that's why when I added my parameters for customise ViewController, it didn't affect on final result. For use new change I have to Clear Build Folder (Shift+Cmd+K) and Run compiler again. After that new changes affect on the project.
-
I didn't mention about that issue, but I think maybe it will be useful. When I use DefaultColorPicker I could set "Selected Color", before open ViewController in this way:
if let destinationColorPicker = segue.destination as? ColorPickerControllerProtocol {
destinationColorPicker.delegate = self
destinationColorPicker.selectedColor = UIColor.systemPink
}
But it does not work with CustomColorPicker. For do that i had to create Segue and instance of CustomColorPicker class. I don't know whether my method is elegant but it works. Maybe @RastislavMirek could tell, what the best way to do that.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
print("Prepare seque color picker")
if let destinationColorPicker = segue.destination as? ColorPickerControllerProtocol {
destinationColorPicker.delegate = self
}
if segue.identifier == "PresentColorPicker" {
let destVC = segue.destination as! CustomColorPickerViewController
destVC.selectedColor = sender as? UIColor ?? .white
}
}
from flexcolorpicker.
And also, sometimes one issue appear when I try run project. What does it mean?
from flexcolorpicker.
Related Issues (20)
- SwiftUI support needed HOT 1
- When installed via SPM or CocoaPods unnecessary files are downloaded HOT 1
- Allow the Demo to be selectivelly installed and run via SPM
- ColorPicker Takes time to Load HOT 1
- iOS 13 dark mode support HOT 2
- Swift 5.2 complaint HOT 1
- 1.4.1 Won't Run HOT 4
- Add Other Rectangular Picker HOT 2
- Is it me or is does brightness work backwards? HOT 4
- I want to change the ColorPicker Background color according to our desire.
- ColorPickerDelegate HOT 2
- Invalid Excludes when using with Xcode 13 HOT 2
- AutoLayout With ScrollView Crashing - iOS 15 Xcode 13 HOT 2
- Crash iOS15 HOT 19
- Memory leak HOT 1
- I want this Color picker in UIView. Can I subclass this..? HOT 1
- Can I have my custom colors in circle palette. HOT 1
- How to set custom colors to RadialPaletteControl.
- RectangularPaletteControl has 'open' function but not declared is 'open'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexcolorpicker.