You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
// // SendMoneyCodePresenter.swift // GME Remit // // Created by gme_2 on 27/02/2019. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. //
import Foundation
class SendMoneyCodePresenter { // MARK: Properties weak var view: SendMoneyCodeViewInterface? var interactor: SendMoneyCodeInteractorInput? var wireframe: SendMoneyCodeWireframeInput? var otpCount = 0 // MARK: Converting entities }
// MARK: SendMoneyCode module interface
extension SendMoneyCodePresenter: SendMoneyCodeModuleInterface { func changeProfileResendOTP(newValue: String) { if otpCount < 2 { view?.showLoading() interactor?.changeProfileResendOTP(newValue: newValue) otpCount += 1 } else { let error = NSError( domain: "OTP Count Error", code: 0, message: "The transaction request period has expired.\nPlease try to send money again." ) self.view?.expiredError(error: error) } } func viewIsReady() { if otpCount < 3 { self.view?.showLoading() interactor?.viewIsReady() otpCount += 1 } else { let error = NSError( domain: "OTP Count Error", code: 0, message: "The transaction request period has expired.\nPlease try to send money again." ) self.view?.expiredError(error: error) } } }
// MARK: SendMoneyCode interactor output interface
extension SendMoneyCodePresenter: SendMoneyCodeInteractorOutput { func show(error: Error) { self.view?.hideLoading() self.view?.show(error: error.localizedDescription) } func successChangeProfileInformation() { self.view?.hideLoading() view?.successChangeProfileInformation() } func show(message: String) { self.view?.hideLoading() self.view?.show(message: message) } }
|