davydliu / dlradiobutton Goto Github PK
View Code? Open in Web Editor NEWRadio Button for iOS
License: MIT License
Radio Button for iOS
License: MIT License
Hello,
The button does not work if added to a UIScrollView, do you have any idea why?
I am using this control in a way where the selected and not selected states have different colors besides the inner circle being drawn.
If you change the icon or indicator color the buttons aren't redrawn using the new colors.
It would be nice to see the addition to be able to set a color for the selected state.
Another way would be to force a redraw if the colors of the control have changed.
The workaround I found was to set the icon or iconselected to nil and calling setNeedsDisplay to force a redraw for the newly assigned color. Which seems to me as a bit hacky.
Can you give an example of how to use checkbox with Swift 2? I have set up an IBAction outlet and a IBOutlet but there is no intellisense that pops up so I am at a lost where to do from here. I am a newbie to Swift. I want to create a checkbox and by default it is not checked.
Example, I have 3 radio buttons, ( Goat tag with 1, Horse tag with 2, Cow tag with 3). User selected Horse , which saves "2" in the database. User goes back to edit record, how can I show "Horse" was selected?
Thanks.
hi,
i got two error messages:
ArticleListing.storyboard: error: IB Designables: Failed to update auto layout status: Failed to load designables from path (null)
and
ArticleListing.storyboard: error: IB Designables: Failed to render instance of DLRadioButton: Failed to load designables from path (null)
any idea?
I want to set a color when button clicked, and another color when button not selected. But I can't do it with storyboard. Because the first button's default style always be the selected style.
Hi,
Love this! However I cannot figure out how to use the checkbox as a toggle? For instance just have one checkbox and have it selectable and unselectable. Maybe I am just overlooking something simple!
Thanks!
Does it support Swift 3 ?
Hi, I have a small problem with your library. The radio button only appear after I select it for some reason.
As shown on screenshot below:
Any idea what is going on? Thanks :)
I am beginner in swift IOS I used this library is very nice But Problem is once i select it. I cant deselect. Please help me with this problem.
I am taking two new UIButtons and I used custom class as DLRadioButton. If button group is require for that Just let me know how to get it exactly.
Thanks.
I like how the radio buttons in DLRB interact, but I also want a button to deselect if it is selected with a second touch. My intent is for all the buttons to be deselected as when the app first opened. How can DLRadioButton be updated to do this?
Thanks for the help, I am new and learning.
First of all thank you for creating DLRadioButton. The issue I want to discuss is as below.
I have added two radio buttons. Buttons are added using interface builder.
When the view loads up the round icon on the left of the button does not show.
But when I select the button round icon shows for that button and same for other button.
Once they are appeared both works fine.
I don't understand what is the problem. Help me here.
Thanks.
Hi, First of all thanks for your great work. Do this buttons have a setVisibility option or something like that? because when I use .hidden I can hide the button but when I set it equal to false the button doesn't appear again.
Thanks
Hello,
I'm using this library in my project (Swift) and I don't know how to change to color of a selected radio in runtime.
You can see color of the third radio button (selected) does not change.
This is how I tried to change the color.
func setButtonColor(button: UIButton, color: UIColor){
button.setTitleColor(color, forState: UIControlState.Disabled)
button.setTitleColor(color, forState: UIControlState.Normal)
button.setTitleColor(color, forState: UIControlState.Highlighted)
button.setTitleColor(color, forState: UIControlState.Selected)
button.setTitleColor(color, forState: UIControlState.Reserved)
button.setTitleColor(color, forState: UIControlState.Focused)
button.setTitleColor(color, forState: UIControlState.Application)
}
Please help me solve this problem.
Thank you.
Currently If I tried changing its button width and buttonSideLength its corner radius is out of the sky! Its not proper at all. Any help?
Hi DavydLiu,
Is this possible to be implemented as checkbox button? if so how do we do it in swift as I don't seems to be able to toggle it's state for checked and unchecked display.
Thank for the great work..! I was just concern about how do I show a radio button selected by default because all the buttons are deselected by default and the user may or may not be clicking on the radio button because I cannot force them to do so . Thats why I just want that any of the radio group button should be shown as selected by default. Is there any way to do this??
Thanks
Nevermind, after a XCode restart, it got fixed.
Hello, first of all thanks for the great code! In my storyboard, I get the error error: IB Designables: Failed to render instance of DLRadioButton: Rendering the view took longer than 200 ms. Your drawing code may suffer from slow performance.
The app runs but the red error is always there. Is anything affecting performance, and any way to get rid of this error? Thanks again!
how can i choose only one radio button and unselect other using swift
I am unable to find this section: https://github.com/DavydLiu/DLRadioButton/raw/master/Images/design_DLRadioButton.png
I'm on Xcode 7.3.1
I'm new to swift/ios dev. Came across your library and found it extremely useful. However, I'm wondering if there's a quick way to retrieve the current selection in the group?
For example, i have 4 options A,B,C,D. Can I group them under 'radioGroup1' and just do a radioGroup1.selected or something like that to directly get the value of the selected?
How to set a radio button selected by default programmatically?
Can you provide how to use the component without text
tks
I'm creating the buttons programmatically and adding them to the cell of a tableview. They are not drawing.
Absolutely love this pod but I find it increasingly frustrating that the version number keeps on incrementing without any good reason
As an example, the latest version 1.4.4
contains just one commit that fixes a bug in the demo project. The demo project should not be impacted by versioning whatsoever.
Please can we take versioning a bit more seriously. Happy to help
Hi David,
Amazing Library thus far.
I have a question regarding tint color and selected icons.
How can I make it so that when a button is selected, it just changes to the image I set in Icon Selected
without applying a tint color to it or using the tint as part of the transformation?
Thank you,
Jordan
I'm getting the above error if I use your Example project, remove the .framework and add purely just the 2 source files. I'm using objc, so I removed the swift portions as well. Otherwise just refer to attached zip.
Archive.zip
No matter what settings I change, the button will always have white inner and outer circles and the background will be blue (or whatever color i set the button tint to). Your color IBInspectables seem to have no effect.
Hi there,
I am just updating my project to xCode7 and iOS9 and encountered this error for every instance of DLRadioButton in my Storyboard? It also occurs for circleRadius. Setting them manually to the default and restarting xCode didn't work. Any ideas or ideas for a fix? BTW I am using Swift 2.0 / iOS9 / xCode7
file:///blah/blah/Base.lproj/Main.storyboard: warning: IB Designables: Ignoring user defined runtime attribute for key path "circleColor" on instance of "DLRadioButton". Hit an exception when attempting to set its value: [<DLRadioButton 0x7fd4f245b220> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key circleColor.
Seems like because they are set to default it triggers an error. When I set them all manually to a default value in IB I get another error as below:
file:///blah/blah/Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: The agent crashed
file:///blah/blah/Base.lproj/Main.storyboard: error: IB Designables: Failed to render instance of DLRadioButton: The agent crashed
I have tried clearing my Derived Data folder but warnings persist.
When I tap a radio button, it highlights the text next to it in a rectangle, rather than filling in the circle with the indicator.
Hi, good day,
How do I set "otherButtons" outlet? In interface editor or program?
Thanks and have a good one.
Cheng
Hi! Is it possible to change touch action event from UIControlEventTouchDown to UIControlEventTouchUpInside? There is a problem with buttons on scrolling view. When you try to scroll by touching radio button area, event is called but it shouldn't.
IB Designables
Failed to render instance of DLRadioButton:
Failed to load designables form path (null)
I went through the procedure to establish a Podfile containing DLRadioButton. I follow what you are saying about putting a button on my storyboard and changing it to a custom one of DLRadioButton. But it doesn't seem to be able to find the DLRadioButton as an object. Somehow I'm not putting DLRadioButton into the Podfile in such a manner that Swift is able to locate it or am not inserting a proper syntax in my storyboard file to refer to it. My Podfile contains:
platform :ios, '9.0'
target 'ageCalculator' do
use_frameworks!
pod 'DLRadioButton', '~> 1.4'
end
Might you have any idea of where I went astray? Any help would be greatly appreciated.
Thanks...
John
Hi, I'm using Xcode 7.3. I just added the DLRadioButton.m and DLRadioButton.h on my project as said on option 1 of the installation guide.
I was able to assign the class DLRadioButton to a button and compile the application. However when I import DLRadioButton on my swift code in order to create a widget I got an error saying that the DLRadioButton module does not exists.
My code was written in swift.
What can I do?
Thanks
this project is looks good but there is no api documentation so its hard to figure out everything , so it would be nice that we have documentation and simple usage guide both in swift and ios.
thanks you for this awesome library.
Dear,
Thank you for providing very clean code library.
Well, I am using your code in my SWIFT application. So, I am unable to access the function setSelected(Bool). So, I am looking forward to pre-select any one button from a group of two programmatically. How can I achieve this functionality?
Thanks for your nice DLRadioButton package. I made one improvement to a copy of your software which I'll suggest in case you want to add it. Basically I took out the otherButtons array and replaced them with a single mutable set shared among all buttons in a group, added a new -groupWithButton: method, and changed a few places internally to use the set rather than the arrays. If you want the change, let me know and I'll be glad to provide it. Thanks.
Hi, is there a way to change the label color different from the button color?
when i set the mutiple to yes ,there was came out a exception :-[UIImage selectedButtons]: unrecognized selector sent to instance 0x7fd3aca57050,but when set the mutiple to no ,it's worked fine
Thank you for great library!
I want to show people with layout that one button is already selected.
How can I set a selected button before people click?
I am sorry for simple question, since I am new to programming.
I am getting this error everytime I run my project. Using storyboard. Xcode version 7.2.
" Failed to render instance of DLRadioButton: Rendering the view took longer than 200 ms. Your drawing code may suffer from slow performance." And as said, the UI gets stuck for some time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.