LoginSignup
3
3

More than 5 years have passed since last update.

UICollectionViewにヘッダー、フッターを付ける方法がわからない

Last updated at Posted at 2014-11-14

SwiftでUICollectionViewのヘッダー、フッターを表示させる方法がわからない。

どなたかの作った、動くソースがこちらにあった。
https://github.com/hiroto-yamashita/swift-collectionview
↑そのまま起動するとコンパイルエラーになるけど、?とかちょっと触ると動く。
ヘッダーを表示させようとしてるっぽいが、表示されない。

ヘッダービューのクラスを作って、それを
UICollectionViewControllerのcollectionViewメソッド内でオブジェクトを作って返す。
Swiftでできないというわけじゃないですよね。。

【追記】
ヘッダーが表示されない状態のソースをForkしてコンパイルエラーして、pushした。
https://github.com/hanoopy/swift-collectionview

https://github.com/hanoopy/swift-collectionview/blob/master/CollectionViewTutorial/MyCollectionViewController.swift
こちらをみて分かる人がいたらいいなあ〜。

(追記終わり)

Objective-Cでやる方法はこちらとかあった。
http://www.appcoda.com/supplementary-view-uicollectionview-flow-layout/

3
3
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
3
3