Git Product home page Git Product logo

irradiobutton-ios's Introduction

Build Status Platform

IRRadioButton-iOS

  • IRRadioButton-iOS is a powerful radio button for iOS.
  • Pretty simple class that extends standard UIButton functionality. Default and selected states can be configured for every button.

Features

  • Radio buttons

Install

Git

  • Git clone this project.
  • Copy this project into your own project.
  • Add the .xcodeproj into you project and link it as embed framework.

Options

  • You can remove the demo and ScreenShots folder.

Cocoapods

  • Add pod 'IRRadioButton-iOS' in the Podfile
  • pod install

Usage

Basic

It does not need any central manager. Just link the buttons right in Interface Builder, ex:Button A link with B and C: Interface Builder

Alternatively group the buttons using single line of code:

radio1.groupButtons = @[radio1, radio2, radio3];

Select any button, and all other button in the same group become deselected automatically:

radio2.selected = YES; // radio1 and radio3 become deselected

Any button from the group knows which one is selected:

IRRadioButton* r1 = radio1.selectedButton;
IRRadioButton* r2 = radio2.selectedButton;
IRRadioButton* r3 = radio3.selectedButton;
NSAssert (r1==r2 && r2==r3, @"Must be equal");

And a helpful method to select button by tag:

[radio1 setSelectedWithTag:kTagRadio3];

Screenshots

Demo

Copyright

This project is inspired from RadioButton-iOS.

irradiobutton-ios's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.