Context analysis: Co-Occurrence

This commit is contained in:
relikd
2020-06-24 13:09:11 +02:00
parent 4b32df5683
commit 96656438c6
15 changed files with 526 additions and 40 deletions

View File

@@ -25,6 +25,12 @@ enum Pref {
set { Pref.Bool(newValue, "didShowTutorialRecordings") }
}
}
enum ContextAnalyis {
static var CoOccurrenceTime: Int? {
get { Pref.Any("contextAnalyisCoOccurrenceTime") as? Int }
set { Pref.Any(newValue, "contextAnalyisCoOccurrenceTime") }
}
}
enum DateFilter {
static var Kind: DateFilterKind {
get { DateFilterKind(rawValue: Pref.Int("dateFilterType"))! }

View File

@@ -43,6 +43,14 @@ extension UITableView {
func safeMoveRow(_ from: Int, to: Int) {
isFrontmost ? moveRow(at: IndexPath(row: from), to: IndexPath(row: to)) : reloadData()
}
/// Recalculate and apply new `tableHeaderView` height.
func sizeHeaderToFit() {
if let head = tableHeaderView {
head.frame.size.height = head.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height
tableHeaderView = head
}
}
}