mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-15 01:59:07 +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
41 lines
1.3 KiB
Swift
41 lines
1.3 KiB
Swift
//
|
|
// IssueTitleSectionController.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 5/19/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import IGListKit
|
|
|
|
final class IssueTitleSectionController: ListSectionController {
|
|
|
|
var object: IssueTitleModel?
|
|
|
|
override init() {
|
|
super.init()
|
|
inset = UIEdgeInsets(top: Styles.Sizes.rowSpacing, left: 0, bottom: 0, right: 0)
|
|
}
|
|
|
|
override func didUpdate(to object: Any) {
|
|
guard let object = object as? IssueTitleModel 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?.string.viewSize(in: width).height ?? 0)
|
|
}
|
|
|
|
override func cellForItem(at index: Int) -> UICollectionViewCell {
|
|
guard let object = self.object,
|
|
let cell = collectionContext?.dequeueReusableCell(of: IssueTitleCell.self, for: self, at: index) as? IssueTitleCell
|
|
else { fatalError("Collection context must be set, missing object, or cell incorrect type") }
|
|
cell.set(renderer: object.string)
|
|
return cell
|
|
}
|
|
|
|
}
|