mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-17 02:52:01 +08:00
29 lines
953 B
Swift
29 lines
953 B
Swift
//
|
|
// IssueLabeledSectionController.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 6/6/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import IGListKit
|
|
|
|
final class IssueLabeledSectionController: ListGenericSectionController<IssueLabeledModel> {
|
|
|
|
override func sizeForItem(at index: Int) -> CGSize {
|
|
guard let width = collectionContext?.containerSize.width else { fatalError("Collection context must be set") }
|
|
return CGSize(width: width, height: Styles.Sizes.labelEventHeight)
|
|
}
|
|
|
|
override func cellForItem(at index: Int) -> UICollectionViewCell {
|
|
guard let cell = collectionContext?.dequeueReusableCell(of: IssueLabeledCell.self, for: self, at: index) as? IssueLabeledCell,
|
|
let object = self.object
|
|
else { fatalError("Missing collection context, cell incorrect type, or object missing") }
|
|
cell.configure(object)
|
|
return cell
|
|
}
|
|
|
|
}
|
|
|