This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func draw(_ rect: CGRect) { | |
StyleKit.drawCheckBox(frame: rect, mainColor: .main, isChecked: isChecked) | |
} | |
extension UIColor { | |
static var main: UIColor { | |
if #available(iOS 13.0, *) { | |
return UIColor { (traitCollection) -> UIColor in | |
if traitCollection.userInterfaceStyle == .dark { | |
return StyleKit.appMainColorDark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy var fetchedResultsController: NSFetchedResultsController<Event> = { | |
let request: NSFetchRequest<Event> = Event.fetchRequest() | |
request.fetchBatchSize = 20 | |
request.sortDescriptors = [NSSortDescriptor(key: "registered", ascending: false)] | |
let controller = NSFetchedResultsController(fetchRequest: request, managedObjectContext: | |
CoreDataStack.viewContext, sectionNameKeyPath: #keyPath(Event.sectionKey), cacheName: nil) | |
controller.delegate = self | |
try! controller.performFetch() |