5
한 섹션에 대해서만 바닥 글보기를 표시하려면 어떻게합니까?UICollectionView 마지막 단의 바닥 글 만 표시
내가 알기로, 다른 섹션에서 바닥 글보기를 숨기려면 nil
을 전달할 수 없으므로 충돌이 발생합니다.
override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
var v : UICollectionReusableView! = nil
if kind == UICollectionElementKindSectionHeader {
let x = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionHeader, withReuseIdentifier:reuseHeaderIdentifier, forIndexPath:indexPath) as HouseNameReusableView
let h = houses[indexPath.section]
x.nameLabel.text = h["name"] as? String
return x
}else if kind == UICollectionElementKindSectionFooter {
if indexPath.section == houses.count - 1{
let x = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionFooter, withReuseIdentifier:reuseFooterIdentifier, forIndexPath:indexPath) as FooterCollectionReusableView
return x
}
}
return v
}