Browse Source

Enable push notification to be filtered by date

pull/1/head
Jeongbae Kong 5 years ago
parent
commit
3be422ae0f
  1. 6
      GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift

6
GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift

@ -58,7 +58,11 @@ class NotificationHistoryPresenter: ViewModelType {
extension NotificationHistoryPresenter: NotificationHistoryInteractorOutput {
func setNotices(with model: [NoticeModel]) {
progressLinker.onNext(false)
self.model.onNext(model)
let filteredDate = model.sorted(by: { (noticeModel1, noticeModel2) -> Bool in
return noticeModel1.date ?? "" > noticeModel2.date ?? ""
})
self.model.onNext(filteredDate)
}
func setError(with error: Error) {

Loading…
Cancel
Save