質問編集履歴
2
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -232,96 +232,4 @@
|
|
232
232
|
|
233
233
|
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
|
234
234
|
|
235
|
-
⑶CollectionViewのコードです
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
import UIKit
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
private let reuseIdentifier = "Cell"
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
class CollectionViewController: UICollectionViewController {
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
var imageArray : [Dictionary<String, String>] = []
|
252
|
-
|
253
|
-
let saveData = UserDefaults.standard
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
override func viewDidLoad() {
|
258
|
-
|
259
|
-
super.viewDidLoad()
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
self.collectionView!.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "Cell")
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
}
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
override func viewWillAppear(_ animated: Bool){
|
272
|
-
|
273
|
-
super.viewWillAppear(true)
|
274
|
-
|
275
|
-
if saveData.array(forKey: "Image") != nil{
|
276
|
-
|
277
|
-
imageArray = saveData.array(forKey: "Image")as![Dictionary<String,String>]
|
278
|
-
|
279
|
-
}
|
280
|
-
|
281
|
-
collectionView.reloadData()
|
282
|
-
|
283
|
-
}
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
//セクション数を指定します
|
288
|
-
|
289
|
-
override func numberOfSections(in collectionView: UICollectionView) -> Int {
|
290
|
-
|
291
|
-
return 1
|
292
|
-
|
293
|
-
}
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
//セルの個数を指定します
|
298
|
-
|
299
|
-
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
300
|
-
|
301
|
-
return imageArray.count
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
//セルの中身の表示の仕方を変更します
|
308
|
-
|
309
|
-
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
310
|
-
|
311
|
-
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath)
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
let nowIndexPathDictionary = imageArray[indexPath.row]
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
return cell
|
320
|
-
|
321
|
-
}
|
322
|
-
|
323
|
-
}
|
324
|
-
|
325
|
-
|
326
|
-
|
327
235
|
```
|
1
誤字の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -320,7 +320,7 @@
|
|
320
320
|
|
321
321
|
}
|
322
322
|
|
323
|
-
}
|
323
|
+
}
|
324
324
|
|
325
325
|
|
326
326
|
|