Open acegreen opened 8 years ago
Hallo,
i did not look int custom keyboards. Sadly I can't give you any advice. I hope you try it out and let me know. Perhaps I can integrate a project example for that then.
Christian
I guess heres our answer :)
Ahh spoke too soon. I noticed I can't click any of the colors.
A few other points regarding the library. It should have a "sort of" random color picker. For example in my case, I want a 5x5 grid but I don't want them to be shades of one another but as many different colors as possible.
So take a look at the example below. The difference in color as you go down is neglect able and not really useful. I want the user to choose a variety of colors. even 20x20, the colors just fade rather than present you with new colors.
To change the appearance you can use the brand new SwiftColorPickerDataSource
property.
I added the usage of the protocol into the examples. If the dataSource
is not set, the usual colors appear.
Oh ok great.
Can we discuss how to convert the SwiftColorPickerViewController into a UIView?
I started working on it but it doesn't fully work.
This is for the custom keyboard implementation.
Heres the code so far:
https://dl.dropboxusercontent.com/u/8061535/SwiftColorPickerView.swift
Thanks i will take a look, tomorrow.
There is a SwiftColorView
already in my code.
Is there a sample code for the custom keyboard too?`
The view will just present it. I need to convert the view to do all the selection and such, just like a UIPickerView
Updated that code slightly. let me know what you make of it.
Got it working.
So now I can do
let pickerViewFrame = CGRectMake(0.0,0.0, UIScreen.mainScreen().bounds.size.width, 216)
let colorPickerView = SwiftColorPickerView(frame: pickerViewFrame)
colorPickerView.delegate = self
colorPickerView.numberColorsInXDirection = 5
colorPickerView.numberColorsInYDirection = 5
I'll wrap this into a sample project and fork it over soon.
By the way, where is that SwiftColorPickerDataSource property? I used the .swift file from the master repo.
EDIT: Seems I downloaded an old .swift file. found the datasource, now editing the code
I look forward for the sample code.
So how do we do this best. Do I create a new project and repo and reference yours in the read me. or for yours and add my changes?
Best way is that your fork my project and add your changes. You can than add an example for the keyboard use case.
Than i can look into the code and either merge it directly or rewrite my code accordingly.
There is no need for you to link back to me or whatever the license is free to use what ever you want.
Lets have a chat on Skype when you have some time. I'm noticing a crash when selecting multiple times outside of the patternSize (i.e. on the coloredBorderWidth)
Can you provide a sample code. So i can look into it.
Created pull request.
Note: This is my first time doing stuff like this, so might not be pulled/requested/added properly.
@Christian1313 any thoughts?
Hi,
I was wondering if we can use this library with the new iOS custom keyboards. I already use custom keyboards to display a UIPickerView but was wondering if we can this library as well.
I think all I need to do is assign the view SwiftColorView and make my UITextField class conform to the delegate?