@@ -13,7 +13,7 @@ import UIKit
13
13
import RxCocoa
14
14
#endif
15
15
16
- /// A reactive UIPickerView adapter which uses `func pickerView(UIPickerView, titleForRow: Int, forComponent: Int)` to desplay content
16
+ /// A reactive UIPickerView adapter which uses `func pickerView(UIPickerView, titleForRow: Int, forComponent: Int)` to display the content
17
17
/**
18
18
Example:
19
19
@@ -25,10 +25,29 @@ items
25
25
26
26
*/
27
27
open class RxPickerViewStringAdapter < T> : RxPickerViewDataSource < T > , UIPickerViewDelegate {
28
- public typealias TitleForRow = ( RxPickerViewStringAdapter < T > , UIPickerView , T , Int , Int ) -> String ?
28
+ /**
29
+ - parameter dataSource
30
+ - parameter pickerView
31
+ - parameter components
32
+ - parameter row
33
+ - parameter component
34
+ */
35
+ public typealias TitleForRow = (
36
+ _ dataSource: RxPickerViewStringAdapter < T > ,
37
+ _ pickerView: UIPickerView ,
38
+ _ components: T ,
39
+ _ row: Int ,
40
+ _ component: Int
41
+ ) -> String ?
29
42
30
43
private let titleForRow : TitleForRow
31
-
44
+
45
+ /**
46
+ - parameter components: Initial content value.
47
+ - parameter numberOfComponents: Implementation of corresponding delegate method.
48
+ - parameter numberOfRowsInComponent: Implementation of corresponding delegate method.
49
+ - parameter titleForRow: Implementation of corresponding adapter method that converts component to `String`.
50
+ */
32
51
public init ( components: T ,
33
52
numberOfComponents: @escaping NumberOfComponents ,
34
53
numberOfRowsInComponent: @escaping NumberOfRowsInComponent ,
@@ -44,7 +63,7 @@ open class RxPickerViewStringAdapter<T>: RxPickerViewDataSource<T>, UIPickerView
44
63
}
45
64
}
46
65
47
- /// A reactive UIPickerView adapter which uses `func pickerView(UIPickerView, viewForRow: Int, forComponent: Int, reusing: UIView?)` to desplay content
66
+ /// A reactive UIPickerView adapter which uses `func pickerView(UIPickerView, viewForRow: Int, forComponent: Int, reusing: UIView?)` to display the content
48
67
/**
49
68
Example:
50
69
@@ -56,10 +75,29 @@ open class RxPickerViewStringAdapter<T>: RxPickerViewDataSource<T>, UIPickerView
56
75
57
76
*/
58
77
open class RxPickerViewAttributedStringAdapter < T> : RxPickerViewDataSource < T > , UIPickerViewDelegate {
59
- public typealias AttributedTitleForRow = ( RxPickerViewAttributedStringAdapter < T > , UIPickerView , T , Int , Int ) -> NSAttributedString ?
78
+ /**
79
+ - parameter dataSource
80
+ - parameter pickerView
81
+ - parameter components
82
+ - parameter row
83
+ - parameter component
84
+ */
85
+ public typealias AttributedTitleForRow = (
86
+ _ dataSource: RxPickerViewAttributedStringAdapter < T > ,
87
+ _ pickerView: UIPickerView ,
88
+ _ components: T ,
89
+ _ row: Int ,
90
+ _ component: Int
91
+ ) -> NSAttributedString ?
60
92
61
93
private let attributedTitleForRow : AttributedTitleForRow
62
-
94
+
95
+ /**
96
+ - parameter components: Initial content value.
97
+ - parameter numberOfComponents: Implementation of corresponding delegate method.
98
+ - parameter numberOfRowsInComponent: Implementation of corresponding delegate method.
99
+ - parameter attributedTitleForRow: Implementation of corresponding adapter method that converts component to `NSAttributedString`.
100
+ */
63
101
public init ( components: T ,
64
102
numberOfComponents: @escaping NumberOfComponents ,
65
103
numberOfRowsInComponent: @escaping NumberOfRowsInComponent ,
@@ -75,7 +113,7 @@ open class RxPickerViewAttributedStringAdapter<T>: RxPickerViewDataSource<T>, UI
75
113
}
76
114
}
77
115
78
- /// A reactive UIPickerView adapter which uses `func pickerView(pickerView:, viewForRow row:, forComponent component:)` to desplay content
116
+ /// A reactive UIPickerView adapter which uses `func pickerView(pickerView:, viewForRow row:, forComponent component:)` to display the content
79
117
/**
80
118
Example:
81
119
@@ -87,10 +125,31 @@ open class RxPickerViewAttributedStringAdapter<T>: RxPickerViewDataSource<T>, UI
87
125
88
126
*/
89
127
open class RxPickerViewViewAdapter < T> : RxPickerViewDataSource < T > , UIPickerViewDelegate {
90
- public typealias ViewForRow = ( RxPickerViewViewAdapter < T > , UIPickerView , T , Int , Int , UIView ? ) -> UIView
128
+ /**
129
+ - parameter dataSource
130
+ - parameter pickerView
131
+ - parameter components
132
+ - parameter row
133
+ - parameter component
134
+ - parameter view
135
+ */
136
+ public typealias ViewForRow = (
137
+ _ dataSource: RxPickerViewViewAdapter < T > ,
138
+ _ pickerView: UIPickerView ,
139
+ _ components: T ,
140
+ _ row: Int ,
141
+ _ component: Int ,
142
+ _ view: UIView ?
143
+ ) -> UIView
91
144
92
145
private let viewForRow : ViewForRow
93
-
146
+
147
+ /**
148
+ - parameter components: Initial content value.
149
+ - parameter numberOfComponents: Implementation of corresponding delegate method.
150
+ - parameter numberOfRowsInComponent: Implementation of corresponding delegate method.
151
+ - parameter attributedTitleForRow: Implementation of corresponding adapter method that converts component to `UIView`.
152
+ */
94
153
public init ( components: T ,
95
154
numberOfComponents: @escaping NumberOfComponents ,
96
155
numberOfRowsInComponent: @escaping NumberOfRowsInComponent ,
@@ -108,11 +167,35 @@ open class RxPickerViewViewAdapter<T>: RxPickerViewDataSource<T>, UIPickerViewDe
108
167
109
168
/// A reactive UIPickerView data source
110
169
open class RxPickerViewDataSource < T> : NSObject , UIPickerViewDataSource {
111
- public typealias NumberOfComponents = ( RxPickerViewDataSource , UIPickerView , T ) -> Int
112
- public typealias NumberOfRowsInComponent = ( RxPickerViewDataSource , UIPickerView , T , Int ) -> Int
170
+ /**
171
+ - parameter dataSource
172
+ - parameter pickerView
173
+ - parameter components
174
+ */
175
+ public typealias NumberOfComponents = (
176
+ _ dataSource: RxPickerViewDataSource ,
177
+ _ pickerView: UIPickerView ,
178
+ _ components: T ) -> Int
179
+ /**
180
+ - parameter dataSource
181
+ - parameter pickerView
182
+ - parameter components
183
+ - parameter component
184
+ */
185
+ public typealias NumberOfRowsInComponent = (
186
+ _ dataSource: RxPickerViewDataSource ,
187
+ _ pickerView: UIPickerView ,
188
+ _ components: T ,
189
+ _ component: Int
190
+ ) -> Int
113
191
114
192
fileprivate var components : T
115
-
193
+
194
+ /**
195
+ - parameter components: Initial content value.
196
+ - parameter numberOfComponents: Implementation of corresponding delegate method.
197
+ - parameter numberOfRowsInComponent: Implementation of corresponding delegate method.
198
+ */
116
199
init ( components: T ,
117
200
numberOfComponents: @escaping NumberOfComponents ,
118
201
numberOfRowsInComponent: @escaping NumberOfRowsInComponent ) {
0 commit comments