mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-03-30 17:13:47 +08:00
* clean up title model * update title style * organize issue SC method * remove background colors from styled text in issues * collection view bg white * remove card inset and clean up snap superview code * clean up label design * thread is root and change base font size * remove borders on comment cells * adjust collapse design * adjust comment line spacing and make non-root body smaller * refactor detail view * viewer header background color * more buttons in reaction cell * vertical spacers working * design basically finished; * scroll to bottom accounts for inset * PR review background color white * fixup PR review comments * spacing on merge and review * readme background white * rename to just "spacer" * horizontal spacing * fix tests
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
//
|
|
// IssueBranchesSectionController.swift
|
|
// Freetime
|
|
//
|
|
// Created by Yury Bogdanov on 13/03/2018.
|
|
// Copyright © 2018 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import IGListKit
|
|
|
|
final class IssueTargetBranchSectionController: ListSectionController {
|
|
|
|
var object: IssueTargetBranchModel?
|
|
|
|
override func didUpdate(to object: Any) {
|
|
guard let object = object as? IssueTargetBranchModel else { return }
|
|
self.object = object
|
|
}
|
|
|
|
override func sizeForItem(at index: Int) -> CGSize {
|
|
guard let width = collectionContext?.insetContainerSize.width else { fatalError("Collection context must be set") }
|
|
return CGSize(width: width, height: self.object?.targetBranchText.viewSize(in: width).height ?? 0)
|
|
}
|
|
|
|
override func cellForItem(at index: Int) -> UICollectionViewCell {
|
|
guard let object = self.object,
|
|
let cell = collectionContext?.dequeueReusableCell(of: IssueTargetBranchCell.self, for: self, at: index) as? IssueTargetBranchCell
|
|
else { fatalError("Collection context must be set, missing object, or cell incorrect type") }
|
|
cell.set(renderer: object.targetBranchText)
|
|
return cell
|
|
}
|
|
}
|