| { |
| "name": "LTHRadioButton", |
| "module_name": "LTHRadioButton", |
| "version": "1.0.0", |
| "license": { |
| "type": "MIT", |
| "file": "LICENSE.txt" |
| }, |
| "authors": { |
| "Roland Leth": "roland@leth.ro" |
| }, |
| "summary": "A radio button with a pretty animation.", |
| "homepage": "https://rolandleth.github.io/LTHRadioButton/", |
| "source": { |
| "git": "https://github.com/rolandleth/LTHRadioButton.git", |
| "tag": "1.0.0" |
| }, |
| "screenshots": [ |
| "https://rolandleth.com/assets/radio-button/gif.gif", |
| "https://rolandleth.com/assets/radio-button/screenshot-1.png", |
| "https://rolandleth.com/assets/radio-button/screenshot-2.png" |
| ], |
| "source_files": "source/LTHRadioButton.swift", |
| "platforms": { |
| "ios": "9.0" |
| }, |
| "requires_arc": true, |
| "description": "# LTHRadioButton\n\nSlightly inspired by Google's material radio button. \n\nThe clip below has 3 sections: full speed, 25% and 10%, but after converting it to GIF, it actually made it longer, so the 10% part takes a really long time 😄. [Here's](https://rolandleth.com/assets/radio-button/video.mp4) an mp4 link; try with Chrome if Safari doesn't work - for me it doesn't.\n\n![](https://rolandleth.com/assets/radio-button/gif.gif)\n\n## How to use\n\nThe initializer takes up to 3 params: a `radius`, a `selectedColor`, and a `deselectedColor`. All of them are optional:\n\n* `radius` defaults to `18`\n* `selectedColor` defaults to a light blue\n* `deselectedColor` defaults to `UIColor.lightGray`\n\nIt doesn't use Auto Layout internally, but after initialization it will have a proper size, so you can simply create constraints based on its `frame.width` and `frame.height`.\n\n#### Properties\n\n`selectedColor` and `deselectedColor` have been made publicly customizable for cases like a `tableView` with alternating row and radio colors, where the `tableView` might dequeue a cell with one color for displaying a cell with a different color.\n\n`isSelected` - Indicates whether the radio button is selected.\n\n#### Methods\n\n```swift\ninit(radius: CGFloat = 18, selectedColor: UIColor? = nil, deselectedColor: UIColor? = nil) // Colors default internally if nil.\nfunc select(animated: Bool = true) // Selects the radio button.\nfunc deselect(animated: Bool = true) // Deselects the radio button.\n```\n\n### Example\n\n```swift\nlet radioButton = LTHRadioButton(selectedColor: .red)\ncontainer.addSubview(radioButton)\n\nradioButton.translatesAutoresizingMaskIntoConstraints = false\nNSLayoutConstraint.activate([\n radioButton.centerYAnchor.constraint(equalTo: container.centerYAnchor),\n radioButton.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 16),\n radioButton.heightAnchor.constraint(equalToConstant: radioButton.frame.height),\n radioButton.widthAnchor.constraint(equalToConstant: radioButton.frame.width)]\n)\n\n[...]\n\nradioButton.select()\n\n[...]\n\nradioButton.deselect(animated: false)\n```\n\n## Apps using this control\n\nIf you're using this control, I'd love hearing from you! \n\n## License\nLicensed under MIT. If you'd like (or need) a license without attribution, don't hesitate to [contact me](mailto:roland@leth.ro).", |
| "pushed_with_swift_version": "3.0" |
| } |