From 169a762775f2c9990138fe5dd35b7b2a3f2b3789 Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Fri, 7 Feb 2020 13:34:14 +0900 Subject: [PATCH 01/12] add occupation logic --- .../Model/KYCInfromation.swift | 1 + .../Model/PersonalInformation.swift | 3 ++ .../Presenter/NewRegisterStep1Presenter.swift | 2 ++ .../View/NewRegisterStep1.storyboard | 33 ++++++++++++++----- .../View/NewRegisterStep1ViewController.swift | 19 +++++++++-- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/KYCInfromation.swift b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/KYCInfromation.swift index ddfe496b..4a38b223 100644 --- a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/KYCInfromation.swift +++ b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/KYCInfromation.swift @@ -13,6 +13,7 @@ struct KYCInformation: Mappable { var banks: [KJBank]? var idTypes: [KeyValue]? var branches: [KeyValue]? + var occupations: [KeyValue]? var personalInformation: PersonalInformation? var primaryInformation: PrimaryInformation? diff --git a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/PersonalInformation.swift b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/PersonalInformation.swift index 32dd8d68..2287005a 100644 --- a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/PersonalInformation.swift +++ b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Model/PersonalInformation.swift @@ -15,6 +15,7 @@ struct PersonalInformation: Mappable { var email: String? var city: String? var address: String? + var occupation: String? var nativeCountry: String? @@ -25,6 +26,7 @@ struct PersonalInformation: Mappable { email: String?, city: String?, address: String?, + occupation: String?, nativeCountry: String? ) { self.fullName = fullName @@ -47,6 +49,7 @@ struct PersonalInformation: Mappable { email <- map["email"] city <- map["city"] address <- map["address"] + occupation <- map["occupation"] nativeCountry <- map["nativeCountry"] } } diff --git a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift index c5fa6be9..9887ab3f 100644 --- a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift +++ b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift @@ -68,6 +68,7 @@ class NewRegisterStep1Presenter: ViewModelType { let banks: Driver<[KJBank]?> let idTypes: Driver<[KeyValue]?> let branches: Driver<[KeyValue]?> + let occupations: Driver<[KeyValue]?> let isSetPersonalInformation: Driver let isSetPrimaryInformation: Driver @@ -286,6 +287,7 @@ class NewRegisterStep1Presenter: ViewModelType { banks: model.map {$0.banks}.asDriverOnErrorJustComplete(), idTypes: model.map {$0.idTypes}.asDriverOnErrorJustComplete(), branches: model.map {$0.branches}.asDriverOnErrorJustComplete(), + occupations: model.map {$0.occupations}.asDriverOnErrorJustComplete(), isSetPersonalInformation: isSetPersonalInformation, isSetPrimaryInformation: isSetPrimaryInformation, isSetPictureInformation: isSetPictureInformation, diff --git a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard index a840ce3d..d6980ca6 100644 --- a/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard +++ b/GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard @@ -29,16 +29,16 @@ - + - + - + - + @@ -63,7 +63,7 @@ - + @@ -181,8 +181,22 @@ - + + - + - + @@ -120,35 +165,35 @@ - + - + - + - + - + - + @@ -156,7 +201,7 @@ - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift index bb6b88d0..0f93abcb 100644 --- a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift +++ b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift @@ -19,6 +19,12 @@ class DetailNotificationViewController: UIViewController { // MARK: Computed Properties // MARK: IBOutlets + @IBOutlet private weak var imageView: UIImageView! + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var contentLabel: UILabel! + @IBOutlet private weak var dateLabel: UILabel! + @IBOutlet private weak var okButton: UIButton! + @IBOutlet private weak var contentView: UIView! // MARK: VC's Life cycle override func viewDidLoad() { @@ -28,6 +34,7 @@ class DetailNotificationViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + title = "Notice" } override func viewWillDisappear(_ animated: Bool) { @@ -48,15 +55,30 @@ extension DetailNotificationViewController { } private func setUI() { + if self.presentingViewController == nil { + okButton.isHidden = true + } +// contentView.layer.cornerRadius = 5 +// contentView.layer.borderWidth = 1 +// contentView.layer.borderColor = UIColor.themeSeparate.cgColor + okButton.layer.cornerRadius = 5 } private func setUIBinding() { - + okButton.rx.tap.bind {[weak self] in + self?.dismiss(animated: true) + }.disposed(by: disposeBag) } private func setBinding() { - let input = DetailNotificationPresenter.Input() + let viewWillAppear = rx + .sentMessage(#selector(UIViewController.viewWillAppear(_:))).mapToVoid().asDriverOnErrorJustComplete() + + let input = DetailNotificationPresenter.Input( + viewWillAppear: viewWillAppear + ) + let output = presenter.transform(input: input) output.isError @@ -68,5 +90,20 @@ extension DetailNotificationViewController { .drive( onNext: { $0 ? self.showProgressHud() : self.hideProgressHud() } ).disposed(by: disposeBag) + + output.model.map {$0.body}.drive(contentLabel.rx.text).disposed(by: disposeBag) + output.model.map {$0.date}.drive(dateLabel.rx.text).disposed(by: disposeBag) + output.model.map {$0.title ?? ""}.drive(titleLabel.rx.text).disposed(by: disposeBag) + output.model.map {$0.imageURL}.drive(onNext: {[weak self] in + guard let imageURL = $0, let url = URL(string: imageURL) else { + self?.imageView.isHidden = true + return + } + + self?.showProgressHud() + self?.imageView.kf.setImage(with: url) { _ in + self?.hideProgressHud() + } + }).disposed(by: disposeBag) } } diff --git a/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift b/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift index 567472d8..fd18c0d9 100644 --- a/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift +++ b/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift @@ -10,6 +10,7 @@ import UIKit class DetailNotificationWireframe { weak var view: UIViewController! + private var index = "" } extension DetailNotificationWireframe: DetailNotificationWireframeInput { @@ -19,7 +20,7 @@ extension DetailNotificationWireframe: DetailNotificationWireframeInput { func getMainView() -> UIViewController { let service = DetailNotificationService() let interactor = DetailNotificationInteractor(service: service) - let presenter = DetailNotificationPresenter() + let presenter = DetailNotificationPresenter(index: self.index) let viewController = viewControllerFromStoryboard(of: DetailNotificationViewController.self) viewController.presenter = presenter @@ -30,4 +31,18 @@ extension DetailNotificationWireframe: DetailNotificationWireframeInput { view = viewController return viewController } + + func push(with index: String, at viewController: UIViewController) { + self.index = index + let vc = getMainView() + viewController.navigationController?.pushViewController(vc, animated: true) + } + + func open(with index: String, on viewController: UIViewController) { + self.index = index + let vc = getMainView() + let naviVC = UINavigationController(rootViewController: vc) + + viewController.present(naviVC, animated: true) + } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Interactor/NotificationHistoryInteractor.swift b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Interactor/NotificationHistoryInteractor.swift index 65bdfb0a..8062eda8 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Interactor/NotificationHistoryInteractor.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Interactor/NotificationHistoryInteractor.swift @@ -36,4 +36,8 @@ extension NotificationHistoryInteractor: NotificationHistoryInteractorInput { } ) } + + func detail(index: String) { + + } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift index 75572cc1..d19e6918 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift @@ -19,7 +19,7 @@ struct NoticeModel: Mappable { mutating func mapping(map: Map) { title <- map["title"] - key <- map["key"] - date <- map["date"] + key <- map["rowId"] + date <- map["createDate"] } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Service/NotificationHistoryService.swift b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Service/NotificationHistoryService.swift index 03f65c17..03812a3f 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Service/NotificationHistoryService.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Service/NotificationHistoryService.swift @@ -13,46 +13,7 @@ class NotificationHistoryService: NotificationHistoryServiceType { success: @escaping ([NoticeModel]) -> Void, failure: @escaping (Error) -> Void ) { - let test = - """ - { - "Data": [ - { - "title": "test title 1", - "key": "1", - "date": "2019-01-01" - }, - { - "title": "test title 2", - "key": "2", - "date": "2019-01-02" - }, - { - "title": "test title 3", - "key": "3", - "date": "2019-01-03" - }, - { - "title": "test title 4", - "key": "4", - "date": "2019-01-04" - }, - { - "title": "test title 5", - "key": "5", - "date": "2019-01-05" - } - ] - } - """ - - guard let data = ResponseContainerArray(JSONString: test)?.data else { - let error = NSError(domain: "error", code: 0, message: "Test Error") - failure(error) - return - } - - success(data) + APIRouter.getNotifyInfo.json(success: success, failure: failure) } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift index 3797bb58..0f4359c4 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Presenter/NotificationHistoryPresenter.swift @@ -15,6 +15,7 @@ class NotificationHistoryPresenter: ViewModelType { struct Input { let viewWillAppear: Driver + let selectNoticeIndex: Driver } struct Output { @@ -33,9 +34,18 @@ class NotificationHistoryPresenter: ViewModelType { func transform(input: Input) -> Output { input.viewWillAppear.drive(onNext: {[weak self] in + self?.progressLinker.onNext(true) self?.interactor?.fetchNotices() }).disposed(by: disposeBag) + input.selectNoticeIndex + .withLatestFrom(model.asDriverOnErrorJustComplete()) { (indexPath, notices) -> NoticeModel in + return notices[indexPath] + } + .drive(onNext: {[weak self] in + self?.wireframe?.detail(index: $0.key ?? "") + }).disposed(by: disposeBag) + return Output( isError: errorLinker.asDriverOnErrorJustComplete(), isProgress: progressLinker.asDriverOnErrorJustComplete(), @@ -47,10 +57,12 @@ class NotificationHistoryPresenter: ViewModelType { // MARK: NotificationHistory interactor output interface extension NotificationHistoryPresenter: NotificationHistoryInteractorOutput { func setNotices(with model: [NoticeModel]) { + progressLinker.onNext(false) self.model.onNext(model) } func setError(with error: Error) { + progressLinker.onNext(false) errorLinker.onNext(error) } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistoryViewController.swift b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistoryViewController.swift index 508caebb..03629d50 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistoryViewController.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistoryViewController.swift @@ -65,7 +65,8 @@ extension NotificationHistoryViewController { .mapToVoid().asDriverOnErrorJustComplete() let input = NotificationHistoryPresenter.Input( - viewWillAppear: viewWillAppear + viewWillAppear: viewWillAppear, + selectNoticeIndex: tableView.rx.itemSelected.map {$0.row}.asDriverOnErrorJustComplete() ) let output = presenter.transform(input: input) diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframe.swift b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframe.swift index 6117d53f..f96ad1c9 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframe.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframe.swift @@ -30,4 +30,8 @@ extension NotificationHistoryWireframe: NotificationHistoryWireframeInput { view = viewController return viewController } + + func detail(index: String) { + DetailNotificationWireframe().push(with: index, at: view) + } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframeInput.swift b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframeInput.swift index c7098e91..ca382d56 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframeInput.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/Wireframe/NotificationHistoryWireframeInput.swift @@ -9,5 +9,5 @@ import Foundation protocol NotificationHistoryWireframeInput: WireframeInput { - + func detail(index: String) } From c934cb782ceb30c889dd38e0be60c9addae8c1f6 Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Thu, 13 Feb 2020 15:55:25 +0900 Subject: [PATCH 06/12] Implement Push Notification --- .DS_Store | Bin 10244 -> 10244 bytes GME Remit/AppDelegate.swift | 24 ++++++++-- .../View/HomeViewController.swift | 2 + .../View/DetailNotification.storyboard | 37 ++++----------- .../DetailNotificationViewController.swift | 12 ----- .../DetailNotificationWireframe.swift | 4 +- .../Application Logic/Model/NoticeModel.swift | 2 + .../View/NotificationCell.swift | 5 +++ .../View/NotificationHistory.storyboard | 42 +++++++++++++++--- .../NotificationHistoryViewController.swift | 9 +++- .../NotificationHistoryWireframe.swift | 7 +++ .../new.imageset/Contents.json | 21 +++++++++ .../Assets.xcassets/new.imageset/new.png | Bin 0 -> 3045 bytes .../new2.imageset/Contents.json | 21 +++++++++ .../Assets.xcassets/new2.imageset/new2.png | Bin 0 -> 137 bytes 15 files changed, 132 insertions(+), 54 deletions(-) create mode 100644 GME Remit/Supported Files/Assets.xcassets/new.imageset/Contents.json create mode 100644 GME Remit/Supported Files/Assets.xcassets/new.imageset/new.png create mode 100644 GME Remit/Supported Files/Assets.xcassets/new2.imageset/Contents.json create mode 100644 GME Remit/Supported Files/Assets.xcassets/new2.imageset/new2.png diff --git a/.DS_Store b/.DS_Store index e1a7ba5c932e1277b8f1fe37497e1da26653b740..c51104400abcf35e458824f5e9d6fc18aa21cd17 100644 GIT binary patch delta 37 rcmZn(XbITxMx1G~=VSv3gUNCd6PO+_OfHmC*nB}kh94xnL0k*~156Ck delta 37 rcmZn(XbITxMw}_uZ?b`e!DKm!2}}zZCKpO6Y`!2N!w(YPAT9;~_y7zr diff --git a/GME Remit/AppDelegate.swift b/GME Remit/AppDelegate.swift index ecf5dc98..3ff5d0ca 100644 --- a/GME Remit/AppDelegate.swift +++ b/GME Remit/AppDelegate.swift @@ -30,9 +30,23 @@ let server: Server = .live var destination: PushNotificationDestination? var overlayView: UIView? -enum PushNotificationDestination: String { - case trasactionHistory = "TransactionHistory" - case rechargeHistory = "RechargeHistory" +enum PushNotificationDestination { + case trasactionHistory + case rechargeHistory + case pushNotification + + static func getDestination(target: String) -> PushNotificationDestination? { + switch target { + case "TransactionHistory": + return .trasactionHistory + case "RechargeHistory": + return .rechargeHistory + case "PushNotification": + return .pushNotification + default: + return nil + } + } } @UIApplicationMain @@ -211,6 +225,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate { TransactionHistoryGroupWireframe().open(overseasType: .inbound, on: baseVC) case .rechargeHistory: RechargeHistoryWireframe().open(on: baseVC) + case .pushNotification: + NotificationHistoryWireframe().open(on: baseVC) } } @@ -222,7 +238,7 @@ extension AppDelegate { private func extractDestination(userInfo: [String : AnyObject]?) -> PushNotificationDestination? { guard let destination = userInfo?["destination"] as? String, - let destinationType = PushNotificationDestination(rawValue: destination) else { + let destinationType = PushNotificationDestination.getDestination(target: destination) else { return nil } diff --git a/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift b/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift index 7754c14a..e156b22e 100644 --- a/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift +++ b/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift @@ -122,6 +122,8 @@ class HomeViewController: UIViewController { presenter?.openRechargeHistory() case .trasactionHistory: presenter?.openTransactionHistory(type: .inbound) + case .pushNotification: + NotificationHistoryWireframe().open(on: self) } destination = nil diff --git a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotification.storyboard b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotification.storyboard index 4a0791e2..88120480 100644 --- a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotification.storyboard +++ b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotification.storyboard @@ -26,31 +26,31 @@ - + - + - + - + - + @@ -129,28 +129,13 @@ - - - + - - @@ -160,7 +145,6 @@ - @@ -191,9 +175,6 @@ - - - diff --git a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift index 0f93abcb..135081d6 100644 --- a/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift +++ b/GME Remit/Modules/Notice/DetailNotification/User Interface/View/DetailNotificationViewController.swift @@ -23,7 +23,6 @@ class DetailNotificationViewController: UIViewController { @IBOutlet private weak var titleLabel: UILabel! @IBOutlet private weak var contentLabel: UILabel! @IBOutlet private weak var dateLabel: UILabel! - @IBOutlet private weak var okButton: UIButton! @IBOutlet private weak var contentView: UIView! // MARK: VC's Life cycle @@ -55,20 +54,9 @@ extension DetailNotificationViewController { } private func setUI() { - if self.presentingViewController == nil { - okButton.isHidden = true - } - -// contentView.layer.cornerRadius = 5 -// contentView.layer.borderWidth = 1 -// contentView.layer.borderColor = UIColor.themeSeparate.cgColor - okButton.layer.cornerRadius = 5 } private func setUIBinding() { - okButton.rx.tap.bind {[weak self] in - self?.dismiss(animated: true) - }.disposed(by: disposeBag) } private func setBinding() { diff --git a/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift b/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift index fd18c0d9..bee3ecd0 100644 --- a/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift +++ b/GME Remit/Modules/Notice/DetailNotification/User Interface/Wireframe/DetailNotificationWireframe.swift @@ -38,11 +38,11 @@ extension DetailNotificationWireframe: DetailNotificationWireframeInput { viewController.navigationController?.pushViewController(vc, animated: true) } - func open(with index: String, on viewController: UIViewController) { + func open(with index: String, on viewController: UIViewController?) { self.index = index let vc = getMainView() let naviVC = UINavigationController(rootViewController: vc) - viewController.present(naviVC, animated: true) + viewController?.present(naviVC, animated: true) } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift index d19e6918..5e71a47b 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/Application Logic/Model/NoticeModel.swift @@ -12,6 +12,7 @@ struct NoticeModel: Mappable { var title: String? var key: String? var date: String? + var isRead: String? init?(map: Map) { @@ -21,5 +22,6 @@ struct NoticeModel: Mappable { title <- map["title"] key <- map["rowId"] date <- map["createDate"] + isRead <- map["isRead"] } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift index 4821e466..c4c83920 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift @@ -12,9 +12,14 @@ class NotificationCell: UITableViewCell { @IBOutlet private weak var titleLabel: UILabel! @IBOutlet private weak var dateLabel: UILabel! + @IBOutlet private weak var newIconImageView: UIImageView! func setModel(_ model: NoticeModel) { + newIconImageView.isHidden = false + titleLabel.text = model.title dateLabel.text = model.date + + newIconImageView.isHidden = model.isRead == "1" } } diff --git a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard index 5a2713f2..745251e0 100644 --- a/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard +++ b/GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard @@ -35,7 +35,7 @@