https://github.com/shutdownr/circlepicker
A custom UIView for multiple choice selection
https://github.com/shutdownr/circlepicker
ios swift ui ui-components uikit xcode
Last synced: 7 months ago
JSON representation
A custom UIView for multiple choice selection
- Host: GitHub
- URL: https://github.com/shutdownr/circlepicker
- Owner: shutdownr
- License: mit
- Created: 2018-01-25T11:46:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T10:34:46.000Z (about 8 years ago)
- Last Synced: 2025-01-10T04:34:39.894Z (about 1 year ago)
- Topics: ios, swift, ui, ui-components, uikit, xcode
- Language: Swift
- Homepage:
- Size: 4.92 MB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CirclePicker
by Tim Kreuzer
CirclePicker is a custom UIView. It allows multiple choice selection of different elements which can be customised by the programmer. Furthermore you can configure CirclePicker for your own needs with multiple parameters.
Requirements
- iOS 9.0+
- Xcode 9.0+
Installation
Download and copy the files from "Code" to your Xcode-project and you're good to go.
You can also install CirclePicker using CocoaPods.
Add the following line in your Podfile:
pod 'CirclePicker'
Usage
Create a new Object of the type CirclePicker. You need to set the dataSource attribute (CirclePickerDataSource-protocol) to fill it with data. Then you can use the method attachToView(_ :) to attach the picker to a certain view. The picker itself will be displayed now. In order to respond to user interaction, you need to set the delegate attribute (CirclePickerDelegate-protocol) which will be called on every interaction.
Your code should look something like this:
class MyViewController : UIViewController, CirclePickerDelegate, CirclePickerDataSource {
...
let picker = CirclePicker()
picker.dataSource = self
picker.delegate = self
picker.attachToView(myView)
...