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
class ReusableView<ViewModelType: ViewModel> where ViewModelType.ViewType == ReusableView<ViewModelType> { | |
var viewMdoel: ViewModelType! | |
} |
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
protocol ViewModel { | |
associatedtype ViewType | |
var view: ViewType! {get} | |
} |
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
let groups = Dictionary(grouping: events) { | |
return Calendar.current.dateComponents([.year, .month, .day], from: $0.date) | |
} | |
.map({ element in | |
(Calendar.current.date(from: element.key)!, element.value) | |
}) | |
.sorted(by: { elemnet1, element2 -> Bool in | |
elemnet1.0 > element2.0 | |
}) |