Giter Site home page Giter Site logo

Comments (4)

RastislavMirek avatar RastislavMirek commented on July 30, 2024

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.

JLightMedia avatar JLightMedia commented on July 30, 2024

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.
Screenshot 2020-08-02 at 13 50 44

And also one ViewController lost RadialHueControl. I just download demo project and run. Do I need to do some think else?
Screenshot 2020-08-02 at 13 51 24

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.

JLightMedia avatar JLightMedia commented on July 30, 2024

Hi. I've founded some answer on my questions. May be for someone it will be useful.

  1. 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.

  2. 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.

JLightMedia avatar JLightMedia commented on July 30, 2024

And also, sometimes one issue appear when I try run project. What does it mean?
Screenshot 2020-08-11 at 17 57 40

from flexcolorpicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.