diff --git a/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard b/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard index deacbbf1..07868140 100644 --- a/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard +++ b/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard @@ -1,12 +1,11 @@ - + - - + @@ -34,7 +33,7 @@ - + @@ -119,6 +118,7 @@ + @@ -127,8 +127,8 @@ - - + + diff --git a/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdateViewController.swift b/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdateViewController.swift index 19e23fbc..e8ef0d5e 100644 --- a/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdateViewController.swift +++ b/GMERemittance/Module/AppUpdate/User Interface/View/AppUpdateViewController.swift @@ -10,9 +10,16 @@ import UIKit class AppUpdateViewController: UIViewController { + struct StringConstants { + static let updateMessageText = "New update is available" + static let updateText = "Update" + static let notNowText = "Not Now" + } + // MARK: Properties @IBOutlet weak var updateButton: UIButton! + @IBOutlet weak var updateMessageTextLabel: UILabel! @IBOutlet weak var notNowButton: UIButton! var presenter: AppUpdateModuleInterface? @@ -41,6 +48,13 @@ class AppUpdateViewController: UIViewController { let shouldHideDismiss = Utility.isCriticalUpdate() self.notNowButton.isHidden = shouldHideDismiss configureUpdateButton() + configureText() + } + + private func configureText() { + self.updateMessageTextLabel.text = StringConstants.updateMessageText + self.updateButton.setTitle(StringConstants.updateText, for: UIControlState.normal) + self.notNowButton.setTitle(StringConstants.notNowText, for: UIControlState.normal) } func configureUpdateButton() { diff --git a/GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift b/GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift index eeb55f13..fd412eec 100644 --- a/GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift +++ b/GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift @@ -10,6 +10,17 @@ import UIKit class AutoDebitViewController: UIViewController { + struct StringConstants { + static let navigationTitle = "Manage Auto Debit Account" + static let languageUnavailableError = "No Lanugages Available" + static let pickerTitle = "Select Language" + static let cancelText = "Cancel" + static let deleteTitleText = "You want to delete Auto-Debit Account!" + static let confirmationText = "Are you sure?" + static let deleteText = "Delete" + static let editText = "Edit" + } + // MARK:- IBOutlets @IBOutlet weak var tableView: UITableView! @IBOutlet weak var viewAddAccount: UIView! // this is the view that contains add reciepient. should be header @@ -77,7 +88,7 @@ class AutoDebitViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.setupNormalNavigation() - self.navigationItem.title = "Manage Auto Debit Account" + self.navigationItem.title = StringConstants.navigationTitle fetchReceipients() } @@ -113,7 +124,7 @@ class AutoDebitViewController: UIViewController { if (self.languages ?? []).isEmpty { - self.alert(message: "No Lanugages Available") + self.alert(message: StringConstants.languageUnavailableError) } showLanguageSelection() @@ -126,7 +137,7 @@ class AutoDebitViewController: UIViewController { } private func showLanguageSelection() { - let picker = UIAlertController.init(title: "Select Language", message: nil, preferredStyle: UIAlertControllerStyle.actionSheet) + let picker = UIAlertController.init(title: StringConstants.pickerTitle, message: nil, preferredStyle: UIAlertControllerStyle.actionSheet) self.languages?.forEach({language in let action = UIAlertAction.init(title: language.value, style: UIAlertActionStyle.default, handler: { (action) in @@ -135,21 +146,10 @@ class AutoDebitViewController: UIViewController { picker.addAction(action) }) - let cancelAction = UIAlertAction.init(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil) + let cancelAction = UIAlertAction.init(title: StringConstants.cancelText, style: UIAlertActionStyle.cancel, handler: nil) picker.addAction(cancelAction) self.present(picker, animated: true, completion: nil) } - - private func createDummyLangugage() -> [KftcLanguage] { - let leng = KftcLanguage() - leng.key = "eng" - leng.value = "English" - - let leng1 = KftcLanguage() - leng1.key = "Nepali" - leng1.value = "Nepali" - return [leng, leng1] - } } extension AutoDebitViewController: UITableViewDelegate,UITableViewDataSource { @@ -174,19 +174,11 @@ extension AutoDebitViewController: UITableViewDelegate,UITableViewDataSource { // startSendMoneyProcess(index: indexPath.row) } -// private func startSendMoneyProcess(index: Int) { -// if let navigation = self.navigationController { -// if let reciepient = self.accounts?.elementAt(index: index) { -// let wireframe = SendMoneyParentWireframe() -//// wireframe.open(for: reciepient, in: navigation) -// } -// } -// } func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { - let delete = UITableViewRowAction(style: .destructive, title: "Delete") { (action, indexPath) in + let delete = UITableViewRowAction(style: .destructive, title: StringConstants.deleteTitleText) { (action, indexPath) in - self.alertWithOkCancel(message: "You want to delete Auto-Debit Account!", title: "Are you sure?", okTitle: "Delete" ,OkStyle: UIAlertActionStyle.destructive, okAction: { + self.alertWithOkCancel(message: StringConstants.deleteTitleText, title: StringConstants.confirmationText, okTitle: StringConstants.deleteTitleText ,OkStyle: UIAlertActionStyle.destructive, okAction: { let defaults = UserDefaults.standard let myUsername = defaults.string(forKey: "com.gmeremit.username") ?? "" @@ -203,7 +195,7 @@ extension AutoDebitViewController: UITableViewDelegate,UITableViewDataSource { }) } - let edit = UITableViewRowAction(style: .normal, title: "Edit") { (action, indexPath) in + let edit = UITableViewRowAction(style: .normal, title: StringConstants.editText) { (action, indexPath) in guard let navigation = self.navigationController else {return} if let reciepient = self.accounts?.elementAt(index: indexPath.row) { diff --git a/GMERemittance/RestApiManager.swift b/GMERemittance/RestApiManager.swift index efea3fc8..f1311674 100644 --- a/GMERemittance/RestApiManager.swift +++ b/GMERemittance/RestApiManager.swift @@ -106,26 +106,7 @@ class RestApiMananger { failure(error) } } - - - -// -// func kftcRequest(method: HTTPMethod, header: [String: Any], url: String, params: [String: Any]?, encoding: ParameterEncoding = JSONEncoding.default, needsAuthorization: Bool = true, success: @escaping (T) -> (), failure: @escaping (Error) -> ()) { -// if NetworkReachabilityManager()?.isReachable ?? false { -// -// manager.request( -// url, -// method: method, -// parameters: params, -// encoding: encoding, -// headers: header -// ).handle(success: success, failure: failure) -// }else { -// let error = NSError.init(domain: "NETWORK_REACHABILITY_DOMAIN", code: 0, userInfo: [NSLocalizedDescriptionKey : "No Internet connection found. 
 -//Check your connection."]) -// failure(error) - - + func requestMultipart( method: HTTPMethod, _ URLString: URLConvertible, diff --git a/GMERemittance/Utility/AppConstants.swift b/GMERemittance/Utility/AppConstants.swift index 6570ca29..afb41272 100644 --- a/GMERemittance/Utility/AppConstants.swift +++ b/GMERemittance/Utility/AppConstants.swift @@ -27,7 +27,6 @@ class AppConstants { static let pennyTestPresentedOnce = "pennyTestPresentedOnce" static let criticalUpdate = "criticalUpdate" static let primaryBankWArningMessage = "Please verify your primary bank account to complete the registration." - static let yearlyLimitNotification = "Yearly LImit" } @@ -81,7 +80,6 @@ class Utility { } static func isCriticalUpdate() -> Bool { -// UserDefaults.standard.set(critical, forKey: AppConstants.criticalUpdate) let val = (UserDefaults.standard.object(forKey: AppConstants.criticalUpdate) as? String )?.lowercased() == "Y".lowercased() return val @@ -94,7 +92,6 @@ class Utility { static func pennyTestPresentedOnce() -> Bool { let val = UserDefaults.standard.bool(forKey: AppConstants.pennyTestPresentedOnce) -// UserDefaults.standard.set(true, forKey: AppConstants.pennyTestPresentedOnce) return val }