0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UICollectionViewDelegateFlowLayoutにはDelegateって書いてたなって話

Posted at

今回の内容

  • 数日前に、UICollectionViewをアプリで使う為UICollectionViewDelegateFlowLayoutを使ったら、プログラムが効いておらず「おや?」ってなったので、その時の事を書いてます。

いきなり結論

  • 作成したUICollectionView.delegate = selfを書き忘れていた為、UICollectionViewDelegateFlowLayoutが働きませんでした。

なぜ気づかなかったか

  • 当時、作成したアプリはUICollectionViewに表示するだけのつもりだった為、delegateメソッドは使わないよねって思ってしまった事

解決

  • 数分考えた結果、UICollectionViewDelegateFlowLayoutにはDelegateって書いてるから、.delegate = selfが要るなって気づきました。

終わり

まだまだ、理解が出来てない事があって楽しい。
ご指摘、ご質問などありましたら、コメントまでお願い致します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?