@@ -47,9 +47,11 @@ var <#name#>: String? {
47
47
48
48
``` swift
49
49
if #available (iOS 9 , * ) {
50
- < #code #>
50
+ < #API available statements#>
51
+ } else if #available (macOS 10.12 , * ) {
52
+ < #API available statements#>
51
53
} else {
52
- < #code #>
54
+ < #fallback statements #>
53
55
}
54
56
```
55
57
@@ -128,51 +130,54 @@ subscript(<#name#>: <#type#>) -> <#type#> {
128
130
}
129
131
```
130
132
131
- - swifttypealias
133
+ - swiftguardself
132
134
133
135
``` swift
134
- typealias < #alias #> = < #existingtype #>
136
+ guard let `self ` = self else {
137
+ return
138
+ }
135
139
```
136
140
137
141
- swiftuitableviewdatasource
138
142
``` swift
139
- func numberOfSectionsInTableView ( tableView : UITableView) -> Int {
143
+ func numberOfSections ( in tableView : UITableView) -> Int {
140
144
return < #count #>
141
145
}
142
146
143
- func tableView (tableView : UITableView, numberOfRowsInSection section : Int ) -> Int {
147
+ func tableView (_ tableView : UITableView, numberOfRowsInSection section : Int ) -> Int {
144
148
return < #count #>
145
149
}
146
150
147
- func tableView (tableView : UITableView, cellForRowAtIndexPath indexPath : NSIndexPath ) -> UITableViewCell {
151
+ func tableView (_ tableView : UITableView, cellForRowAt indexPath : IndexPath ) -> UITableViewCell {
148
152
< #code #>
149
153
}
150
154
```
151
155
152
156
- swiftuicollectionviewdatasource
153
157
154
158
``` swift
155
- func numberOfSectionsInCollectionView ( collectionView : UICollectionView) -> Int {
156
- < #count #>
159
+ func numberOfSections ( in collectionView : UICollectionView) -> Int {
160
+ return < #count #>
157
161
}
158
162
159
- func collectionView (collectionView : UICollectionView, numberOfItemsInSection section : Int ) -> Int {
160
- < #count #>
163
+ func collectionView (_ collectionView : UICollectionView, numberOfItemsInSection section : Int ) -> Int {
164
+ return < #count #>
161
165
}
162
166
163
- func collectionView (collectionView : UICollectionView, cellForItemAtIndexPath indexPath : NSIndexPath ) -> UICollectionViewCell {
167
+ func collectionView (_ collectionView : UICollectionView, cellForItemAt indexPath : IndexPath ) -> UICollectionViewCell {
164
168
< #code #>
165
169
}
166
170
```
167
171
168
172
- swiftuipickerviewdatasource
173
+
169
174
``` swift
170
- func numberOfComponentsInPickerView ( pickerView : UIPickerView) -> Int {
171
- < #count #>
175
+ func numberOfComponents ( in pickerView : UIPickerView) -> Int {
176
+ return < #count #>
172
177
}
173
178
174
- func pickerView (pickerView : UIPickerView, numberOfRowsInComponent component : Int ) -> Int {
175
- < #count #>
179
+ func pickerView (_ pickerView : UIPickerView, numberOfRowsInComponent component : Int ) -> Int {
180
+ return < #count #>
176
181
}
177
182
```
178
183
0 commit comments