mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-03-30 17:13:47 +08:00
34 lines
1.1 KiB
Swift
34 lines
1.1 KiB
Swift
//
|
|
// IssueMilestoneEventSectionController.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 7/19/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import IGListKit
|
|
|
|
final class IssueMilestoneEventSectionController: ListGenericSectionController<IssueMilestoneEventModel> {
|
|
|
|
override func sizeForItem(at index: Int) -> CGSize {
|
|
guard let width = collectionContext?.insetContainerSize.width,
|
|
let object = self.object
|
|
else { fatalError("Collection context must be set") }
|
|
return CGSize(
|
|
width: width,
|
|
height: object.string.viewSize(in: width).height
|
|
)
|
|
}
|
|
|
|
override func cellForItem(at index: Int) -> UICollectionViewCell {
|
|
guard let cell = collectionContext?.dequeueReusableCell(of: IssueMilestoneEventCell.self, for: self, at: index) as? IssueMilestoneEventCell,
|
|
let object = self.object
|
|
else { fatalError("Missing context, object, or wrong cell type") }
|
|
cell.configure(object)
|
|
cell.delegate = viewController
|
|
return cell
|
|
}
|
|
|
|
}
|