Browse Source

added cancel action

pull/1/head
ccr 6 years ago
parent
commit
bf01183972
  1. 2
      GMERemittance/AppDelegate.swift
  2. 18
      GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift
  3. 3
      GMERemittance/Model/Account.swift
  4. 2
      GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift
  5. 9
      GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift
  6. 2
      Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist

2
GMERemittance/AppDelegate.swift

@ -19,7 +19,7 @@ import AlamofireNetworkActivityLogger
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import LGSideMenuController import LGSideMenuController
let server: Server = .stagging
let server: Server = .uat
@UIApplicationMain @UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate { class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate {

18
GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift

@ -29,16 +29,18 @@ class WkWebViewController: UIViewController, WKUIDelegate {
// if let myURL = URL(string: self.url ?? "") {
// var myRequest = URLRequest(url: myURL)
//
// headers.forEach({
// myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "")
// })
let url = URL.init(string: "https://www.apple.com")
let myRequest = URLRequest.init(url: url!)
if let myURL = URL(string: self.url ?? "") {
var myRequest = URLRequest(url: myURL)
headers.forEach({
myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "")
})
print(myRequest.allHTTPHeaderFields)
webView.load(myRequest) webView.load(myRequest)
} }
}
private func addCloseButton() { private func addCloseButton() {
let button = UIBarButtonItem.init(title: "Close", style: UIBarButtonItemStyle.plain, target: self, action: #selector(self._dismiss)) let button = UIBarButtonItem.init(title: "Close", style: UIBarButtonItemStyle.plain, target: self, action: #selector(self._dismiss))

3
GMERemittance/Model/Account.swift

@ -90,7 +90,7 @@ class KFTCModel: Mappable {
var model: [Account]? var model: [Account]?
var url: String? var url: String?
var header: [KftcHeader]? var header: [KftcHeader]?
var language: [KftcLanguage]?
var languages: [KftcLanguage]?
required init?(map: Map) { required init?(map: Map) {
} }
@ -98,6 +98,7 @@ class KFTCModel: Mappable {
func mapping(map: Map) { func mapping(map: Map) {
model <- map["AccountList"] model <- map["AccountList"]
header <- map["Header"] header <- map["Header"]
languages <- map ["Language"]
} }
} }

2
GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift

@ -28,7 +28,7 @@ protocol FetchAccountList: ApiServiceType {
extension FetchAccountList { extension FetchAccountList {
func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) { func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "kftc/GetKftcParameters/" + username
let url = "http://gmeuat.gmeremit.com:5012/api/v2/" + "kftc/GetKftcParameters/" + username
auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

9
GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift

@ -20,7 +20,7 @@ class AutoDebitViewController: UIViewController {
var kftcDetail: KFTCModel? { var kftcDetail: KFTCModel? {
didSet { didSet {
self.accounts = kftcDetail?.model ?? [] self.accounts = kftcDetail?.model ?? []
self.languages = kftcDetail?.language
self.languages = kftcDetail?.languages
self.header = kftcDetail?.header self.header = kftcDetail?.header
self.url = kftcDetail?.url self.url = kftcDetail?.url
self.tableView.reloadData() self.tableView.reloadData()
@ -58,7 +58,7 @@ class AutoDebitViewController: UIViewController {
super.viewWillAppear(animated) super.viewWillAppear(animated)
self.setupNormalNavigation() self.setupNormalNavigation()
self.navigationItem.title = "My Accounts" self.navigationItem.title = "My Accounts"
// fetchReceipients()
fetchReceipients()
} }
override func viewDidLoad() { override func viewDidLoad() {
@ -76,6 +76,7 @@ class AutoDebitViewController: UIViewController {
private func openWkWebViewWith(url: String) { private func openWkWebViewWith(url: String) {
let viewcontroller = UIStoryboard.init(name: "WKWebView", bundle: nil).instantiateViewController(withIdentifier: "WkWebViewController") as! WkWebViewController let viewcontroller = UIStoryboard.init(name: "WKWebView", bundle: nil).instantiateViewController(withIdentifier: "WkWebViewController") as! WkWebViewController
viewcontroller.url = url
let nvc = UINavigationController.init(rootViewController: viewcontroller) let nvc = UINavigationController.init(rootViewController: viewcontroller)
self.present(nvc, animated: true, completion: nil) self.present(nvc, animated: true, completion: nil)
} }
@ -89,7 +90,7 @@ class AutoDebitViewController: UIViewController {
@IBAction func addNewAccount(_ sender: UITapGestureRecognizer) { @IBAction func addNewAccount(_ sender: UITapGestureRecognizer) {
print("add new account") print("add new account")
self.languages = createDummyLangugage()
if (self.languages ?? []).isEmpty { if (self.languages ?? []).isEmpty {
self.alert(message: "No Lanugages Available") self.alert(message: "No Lanugages Available")
} }
@ -113,6 +114,8 @@ class AutoDebitViewController: UIViewController {
picker.addAction(action) picker.addAction(action)
}) })
let cancelAction = UIAlertAction.init(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil)
picker.addAction(cancelAction)
self.present(picker, animated: true, completion: nil) self.present(picker, animated: true, completion: nil)
} }

2
Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist

@ -17,7 +17,7 @@
<key>AlamofireNetworkActivityLogger.xcscheme</key> <key>AlamofireNetworkActivityLogger.xcscheme</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>9</integer>
<integer>8</integer>
</dict> </dict>
<key>BRYXBanner.xcscheme</key> <key>BRYXBanner.xcscheme</key>
<dict> <dict>

Loading…
Cancel
Save