diff --git a/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractor.swift b/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractor.swift new file mode 100644 index 00000000..121247a3 --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractor.swift @@ -0,0 +1,30 @@ +// +// ManageAgreementInteractor.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation + +class ManageAgreementInteractor { + + // MARK: Properties + + weak var output: ManageAgreementInteractorOutput? + private let service: ManageAgreementServiceType + + // MARK: Initialization + + init(service: ManageAgreementServiceType) { + self.service = service + } + +} + +// MARK: ManageAgreement interactor input interface + +extension ManageAgreementInteractor: ManageAgreementInteractorInput { + +} diff --git a/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractorIO.swift b/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractorIO.swift new file mode 100644 index 00000000..a5e5ebb0 --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/Application Logic/Interactor/ManageAgreementInteractorIO.swift @@ -0,0 +1,15 @@ +// +// ManageAgreementInteractorIO.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +protocol ManageAgreementInteractorInput: class { + +} + +protocol ManageAgreementInteractorOutput: class { + +} diff --git a/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementService.swift b/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementService.swift new file mode 100644 index 00000000..1fa7f441 --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementService.swift @@ -0,0 +1,13 @@ +// +// ManageAgreementService.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation + +class ManageAgreementService: ManageAgreementServiceType { + +} diff --git a/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementServiceType.swift b/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementServiceType.swift new file mode 100644 index 00000000..882329d6 --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/Application Logic/Service/ManageAgreementServiceType.swift @@ -0,0 +1,11 @@ +// +// ManageAgreementServiceType.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +protocol ManageAgreementServiceType: class { + +} diff --git a/GME Remit/Modules/ManageAgreement/User Interface/Presenter/ManageAgreementPresenter.swift b/GME Remit/Modules/ManageAgreement/User Interface/Presenter/ManageAgreementPresenter.swift new file mode 100644 index 00000000..923ae3cf --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/User Interface/Presenter/ManageAgreementPresenter.swift @@ -0,0 +1,39 @@ +// +// ManageAgreementPresenter.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import RxSwift +import RxCocoa + +class ManageAgreementPresenter: ViewModelType { + var interactor: ManageAgreementInteractorInput? + var wireframe: ManageAgreementWireframeInput? + + struct Input {} + + struct Output { + let isError: Driver + let isProgress: Driver + } + + private let disposeBag = DisposeBag() + + private let progressLinker = PublishSubject() + private let errorLinker = PublishSubject() + + func transform(input: Input) -> Output { + return Output( + isError: errorLinker.asDriverOnErrorJustComplete(), + isProgress: progressLinker.asDriverOnErrorJustComplete() + ) + } +} + +// MARK: ManageAgreement interactor output interface +extension ManageAgreementPresenter: ManageAgreementInteractorOutput { + +} diff --git a/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard new file mode 100644 index 00000000..b7cf9f6d --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard @@ -0,0 +1,226 @@ + + + + + + + + + + + + + SanFranciscoDisplay-Bold + + + SanFranciscoDisplay-Medium + + + SanFranciscoDisplay-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreementViewController.swift b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreementViewController.swift new file mode 100644 index 00000000..2c8ee9f0 --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreementViewController.swift @@ -0,0 +1,73 @@ +// +// ManageAgreementViewController.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import UIKit +import RxSwift +import RxCocoa + +class ManageAgreementViewController: UIViewController { + + // MARK: Properties + var presenter: ManageAgreementPresenter! + + private let disposeBag = DisposeBag() + + // MARK: Computed Properties + + // MARK: IBOutlets + + // MARK: VC's Life cycle + override func viewDidLoad() { + super.viewDidLoad() + setup() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + } + + // MARK: IBActions + +} + +// MARK: Other Functions +extension ManageAgreementViewController { + + private func setup() { + setUI() + setBinding() + setUIBinding() + } + + private func setUI() { + + } + + private func setUIBinding() { + + } + + private func setBinding() { + let input = ManageAgreementPresenter.Input() + let output = presenter.transform(input: input) + + output.isError + .drive( + onNext: { self.alert(type: .error, message: $0.localizedDescription) } + ).disposed(by: disposeBag) + + output.isProgress + .drive( + onNext: { $0 ? self.showProgressHud() : self.hideProgressHud() } + ).disposed(by: disposeBag) + } +} diff --git a/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift b/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift new file mode 100644 index 00000000..15c20bad --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift @@ -0,0 +1,47 @@ +// +// ManageAgreementWireframe.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import UIKit + +enum PDFType { + case test1 +} + +class ManageAgreementWireframe { + weak var view: UIViewController! +} + +extension ManageAgreementWireframe: ManageAgreementWireframeInput { + + var storyboardName: String {return "ManageAgreement"} + + func getMainView() -> UIViewController { + let service = ManageAgreementService() + let interactor = ManageAgreementInteractor(service: service) + let presenter = ManageAgreementPresenter() + let viewController = viewControllerFromStoryboard(of: ManageAgreementViewController.self) + + viewController.presenter = presenter + interactor.output = presenter + presenter.interactor = interactor + presenter.wireframe = self + + view = viewController + return viewController + } + + func pushWithNavigation(on source: UIViewController) { + let vc = getMainView() + source.navigationController?.pushViewController(vc, animated: true) + } + + func goAgreementPDF(type: PDFType) { + let pdfVC = PDFViewController(nibName: "PDFViewController", bundle: nil) + view.navigationController?.pushViewController(pdfVC, animated: true) + } +} diff --git a/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframeInput.swift b/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframeInput.swift new file mode 100644 index 00000000..58d01efa --- /dev/null +++ b/GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframeInput.swift @@ -0,0 +1,13 @@ +// +// ManageAgreementWireframeInput.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation + +protocol ManageAgreementWireframeInput: WireframeInput { + func goAgreementPDF(type: PDFType) +} diff --git a/GME Remit/MultiLanguages/uz.lproj/Localizable.strings b/GME Remit/MultiLanguages/uz.lproj/Localizable.strings index 49328f10..e52931d0 100644 --- a/GME Remit/MultiLanguages/uz.lproj/Localizable.strings +++ b/GME Remit/MultiLanguages/uz.lproj/Localizable.strings @@ -579,9 +579,9 @@ "bank_placeholder_text" = "Bankni yoki Karta Turini Tanlang"; "branch_placeholder_text" = "Filialni tanlang"; "account_placeholder_text" = "Bank Karta Raqami"; -"first_name_placeholder_text" = "Ismingizni kiriting"; -"middle_name_placeholder_text" = "Otangiz ismini kiriting"; -"last_name_placeholder_text" = "Familiyani kiriting"; +"first_name_placeholder_text" = "Ismini kiriting (Oluvchining)"; +"middle_name_placeholder_text" = "Otasining ismini kiriting"; +"last_name_placeholder_text" = "Familya kiriting"; "full_name_placeholder_text" = "To‘liq ism-sharifni kiriting"; "first_name_local_placeholder_text" = "Ismingizni o'z tilingizda kiriting"; "middle_name_local_placeholder_text" = "Otangizning ismini o'z tilingizda kiriting"; diff --git a/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift b/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift new file mode 100644 index 00000000..6487e598 --- /dev/null +++ b/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift @@ -0,0 +1,42 @@ +// +// PDFViewController.swift +// GME Remit +// +// Created by InKwon James Kim on 2019/12/23. +// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import UIKit +import PDFKit + +struct PDFConfiguration { + var title = "PDF TITLE" + var autoScales = true +} + +class PDFViewController: UIViewController { + + @IBOutlet private weak var pdfView: PDFView! + + var url: String? + private var configure = PDFConfiguration() + + override func viewDidLoad() { + super.viewDidLoad() + + pdfView.autoScales = configure.autoScales + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + setupNormalNavigation() + + title = configure.title + + guard let urlString = url, let url = URL(string: urlString) else { return } + let document = PDFDocument(url: url) + + pdfView.document = document + } +} diff --git a/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.xib b/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.xib new file mode 100644 index 00000000..7582aa35 --- /dev/null +++ b/GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.xib @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +