Skip to content

Commit 1145eeb

Browse files
committed
Merge README
2 parents 91fab33 + 03d14cd commit 1145eeb

1 file changed

Lines changed: 52 additions & 1 deletion

File tree

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,60 @@ Fork of <a href='https://github.com/Akkyie/AKPickerView-Swift'>AKPickerView-Swif
1919

2020
<img src="./Screenshot.gif" width="200" alt="Screenshot" />
2121

22+
## Usage
23+
24+
Since this view is using `UICollectionView` internally you have to provide data same way as you would do with collection view (using dataSource). You can also use delegate if you want to handle item selection or underlaying UIScrollView callbacks. See example project for details.
25+
26+
Set the direction to vertical.
27+
```swift
28+
pickerView.isHorizontal = false
29+
```
30+
31+
Disable wheel effect of the picker.
32+
```swift
33+
pickerView.isFlat = true
34+
```
35+
36+
Prevent center selection when scrolling.
37+
```swift
38+
pickerView.selectCenter = false
39+
```
40+
41+
Set spacing between cells, default 10.
42+
```swift
43+
pickerView.cellSpacing = 10
44+
```
45+
46+
Set cell size (width for horizontal, height for vertical style), default 100.
47+
```swift
48+
pickerView.cellSize = 100
49+
```
50+
51+
Set wheel effect perspective representation.
52+
```swift
53+
pickerView.viewDepth = 2000
54+
```
55+
56+
Disable fading gradient mask.
57+
```swift
58+
pickerView.maskDisabled = true
59+
```
60+
61+
Current selected index might be obtained from `selectedIndex`.
62+
```swift
63+
NSLog("\(pickerView.selectedIndex)")
64+
```
65+
66+
And reload the picker view when any change in data set occurs.
67+
```swift
68+
pickerView.reloadData()
69+
```
70+
71+
72+
2273
## Example
2374

24-
To run the example project, clone the repo, and run `pod install` from the Example directory first.
75+
To run the example project, clone the repo, and run `pod install` from the Example directory first. Or simplest way is just to run `pod try`.
2576

2677
## Installation
2778

0 commit comments

Comments
 (0)