Files
GitHawk/Classes/Issues/Status/IssueStatusSectionController.swift
Ryan Nystrom 65959c7c14 Card inset design completely overhauled (#1396)
* card inset design completely overhauled

* respond to safe area changes
2018-01-13 12:37:00 -05:00

29 lines
979 B
Swift

//
// IssueStatusSectionController.swift
// Freetime
//
// Created by Ryan Nystrom on 6/4/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
import IGListKit
final class IssueStatusSectionController: ListGenericSectionController<IssueStatusModel> {
override func sizeForItem(at index: Int) -> CGSize {
guard let width = collectionContext?.insetContainerSize.width
else { fatalError("Collection context must be set") }
return CGSize(width: floor(width / 2), height: Styles.Sizes.labelEventHeight)
}
override func cellForItem(at index: Int) -> UICollectionViewCell {
guard let cell = collectionContext?.dequeueReusableCell(of: IssueStatusCell.self, for: self, at: index) as? IssueStatusCell,
let object = self.object
else { fatalError("Collection context must be set, cell incorrect type, or missing object") }
cell.bindViewModel(object)
return cell
}
}