Browse Source

app update string managed

pull/1/head
gme_2 6 years ago
parent
commit
057e9ef7fc
  1. 12
      GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard
  2. 14
      GMERemittance/Module/AppUpdate/User Interface/View/AppUpdateViewController.swift
  3. 44
      GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift
  4. 21
      GMERemittance/RestApiManager.swift
  5. 3
      GMERemittance/Utility/AppConstants.swift

12
GMERemittance/Module/AppUpdate/User Interface/View/AppUpdate.storyboard

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
@ -34,7 +33,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="200"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_logo_white_large 2" translatesAutoresizingMaskIntoConstraints="NO" id="lak-SO-oCz">
<rect key="frame" x="126" y="123" width="122" height="35"/>
<rect key="frame" x="126.5" y="123" width="122" height="35"/>
<constraints>
<constraint firstAttribute="width" secondItem="lak-SO-oCz" secondAttribute="height" multiplier="80:23" id="Efp-xM-wQO"/>
<constraint firstAttribute="height" constant="35" id="vIX-bY-Q9o"/>
@ -119,6 +118,7 @@
<connections>
<outlet property="notNowButton" destination="Tom-j5-Wgp" id="nrn-hk-zGV"/>
<outlet property="updateButton" destination="vBA-a9-hIn" id="Nnn-mo-0Uu"/>
<outlet property="updateMessageTextLabel" destination="dFY-cd-fIu" id="Ozt-Jc-mTD"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -127,8 +127,8 @@
</scene>
</scenes>
<resources>
<image name="ic_cloud_banner" width="2000" height="51"/>
<image name="ic_logo_white_large 2" width="332" height="98"/>
<image name="ic_cloud_banner" width="4000" height="102"/>
<image name="ic_logo_white_large 2" width="665" height="196"/>
</resources>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</document>

14
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() {

44
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) {

21
GMERemittance/RestApiManager.swift

@ -106,26 +106,7 @@ class RestApiMananger {
failure(error)
}
}
//
// func kftcRequest<T: Mappable>(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<T: Mappable>(
method: HTTPMethod,
_ URLString: URLConvertible,

3
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
}

Loading…
Cancel
Save