Latest 0.1.0
Homepage https://github.com/akinogunc/xRadioButton
License MIT
Platforms ios 8.0
Authors

Swift Version
Version
License
Platform

xRadioButton

Example

First import the module

import xRadioButton

Creating a xRadioButton

let radioButton = xRadioButton(title: "Water", frame: CGRect(x: 100, y: 150, width: 120, height: 40), font: UIFont.boldSystemFont(ofSize: 14), color: UIColor.cyan)
self.view.addSubview(radioButton)

Getting state of the button

radioButton.isSelected

If you want to receive button selection changes, use the delegate

class ..., xRadioButtonDelegate

let radioButton = xRadioButton(title: "Water", frame: CGRect(x: 100, y: 150, width: 120, height: 40), font: UIFont.boldSystemFont(ofSize: 14), color: UIColor.cyan)
radioButton.tag = 1
radioButton.delegate = self
self.view.addSubview(radioButton)

func didSelectButton(sender:xRadioButton) {
  print("Button (sender.tag) is (sender.isSelected)")
}

Requirements

  • iOS 9.0+
  • Xcode 9+
  • Swift 4+

Installation

xRadioButton is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'xRadioButton'

Author

akinogunc, [email protected]

License

xRadioButton is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "xRadioButton",
    "version": "0.1.0",
    "summary": "Radio button for iOS",
    "swift_version": "4.0",
    "description": "xRadioButton is a lightweight RadioButton class for iOS made with swift.",
    "homepage": "https://github.com/akinogunc/xRadioButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "akinogunc": "[email protected]"
    },
    "source": {
        "git": "https://github.com/akinogunc/xRadioButton.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "xRadioButton/Classes/**/*"
}

Pin It on Pinterest

Share This