質問編集履歴

1

。。

2020/01/05 15:30

投稿

iOS25535009
iOS25535009

スコア12

test CHANGED
File without changes
test CHANGED
@@ -379,3 +379,45 @@
379
379
 
380
380
 
381
381
  [[初心者向け]swiftにおける値渡しの方法の一部をご紹介](https://qiita.com/ARATAYOKOYAMA/items/9938cf8acfddf5c5424e)を参考にしてもエラーばかりでて信用なりません。
382
+
383
+
384
+
385
+ ```
386
+
387
+ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
388
+
389
+
390
+
391
+ // タップされたセルの行番号を出力
392
+
393
+ print("(indexPath.row)番目の行が選択されました。")
394
+
395
+
396
+
397
+ //記事画面へ遷移
398
+
399
+ let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "Article") as! ArticleViewController
400
+
401
+ //イメージ画像
402
+
403
+ nextVC.ArticleImage.image = UIImage(named:PostData[indexPath.row])
404
+
405
+
406
+
407
+ self.navigationController?.pushViewController(nextVC, animated: true)
408
+
409
+ }
410
+
411
+
412
+
413
+ ```
414
+
415
+ これだと
416
+
417
+ Value of type 'PostData.Type' has no subscripts
418
+
419
+ というエラーが出ました。
420
+
421
+
422
+
423
+ どうしてもfairebaseにあるものを渡すことができません。