Browse Source

Merge pull request '#401 #392' (#5) from #401 into feature/bugfixes

Reviewed-on: http://202.166.220.79:3000/JME-JAPAN/JME-IOS/pulls/5
pull/6/head
Yajan 3 years ago
parent
commit
bf06ceb75a
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 26
      GME Remit/Modules/RegisterModules/UserAuthentication/ExistingUserKyc/User Interface/View/ExistingUserKycViewController.swift
  3. 25
      GME Remit/Modules/RegisterModules/UserAuthentication/KYCVerifyStep1/User Interface/View/KYCVerifyStep1ViewController.swift
  4. 26
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift
  5. 13
      GME Remit/Utilities/MultiMediaManager.swift

4
GME Remit.xcodeproj/project.pbxproj

@ -7565,7 +7565,7 @@
CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 68KRG7GPAV;
ENABLE_BITCODE = NO;
@ -7605,7 +7605,7 @@
CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 68KRG7GPAV;
ENABLE_BITCODE = NO;

26
GME Remit/Modules/RegisterModules/UserAuthentication/ExistingUserKyc/User Interface/View/ExistingUserKycViewController.swift

@ -97,6 +97,7 @@ class ExistingUserKycViewController: UIViewController {
@IBOutlet weak var termsWebView: WKWebView!
// MARK: VC's Life cycle
var isURLLoaded = false
override func viewDidLoad() {
super.viewDidLoad()
@ -105,6 +106,7 @@ class ExistingUserKycViewController: UIViewController {
self.termsWebView.load(URLRequest(url: url))
self.termsWebView.scrollView.bounces = false
setup()
setWebViewDelegate()
}
override func viewWillAppear(_ animated: Bool) {
@ -780,3 +782,27 @@ extension ExistingUserKycViewController: ImageCropperDelegate {
self.alert(type: .error, message: error.localizedDescription)
}
}
extension ExistingUserKycViewController: WKNavigationDelegate, UIScrollViewDelegate {
func setWebViewDelegate() {
termsWebView.scrollView.delegate = self
termsWebView.navigationDelegate = self
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
isURLLoaded = true
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isURLLoaded {
if scrollView.contentOffset.y >= (scrollView.contentSize.height - scrollView.frame.size.height) {
checkButton.isEnabled = true
} else if scrollView.contentOffset.y < scrollView.contentSize.height {
checkButton.isEnabled = false
}
}
}
}

25
GME Remit/Modules/RegisterModules/UserAuthentication/KYCVerifyStep1/User Interface/View/KYCVerifyStep1ViewController.swift

@ -117,11 +117,13 @@ class KYCVerifyStep1ViewController: UIViewController {
@IBOutlet weak var termsWebView: WKWebView!
// MARK: VC's Life cycle
var isURLLoaded = false
override func viewDidLoad() {
super.viewDidLoad()
self.isFirst = (self.step == .first)
setup()
setWebViewDelegate()
}
override func viewWillAppear(_ animated: Bool) {
@ -988,3 +990,26 @@ extension KYCVerifyStep1ViewController: ImageCropperDelegate {
self.alert(type: .error, message: error.localizedDescription)
}
}
extension KYCVerifyStep1ViewController: WKNavigationDelegate, UIScrollViewDelegate {
func setWebViewDelegate() {
termsWebView.scrollView.delegate = self
termsWebView.navigationDelegate = self
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
isURLLoaded = true
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isURLLoaded {
if scrollView.contentOffset.y >= (scrollView.contentSize.height - scrollView.frame.size.height) {
checkButton.isEnabled = true
} else if scrollView.contentOffset.y < scrollView.contentSize.height {
checkButton.isEnabled = false
}
}
}
}

26
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift

@ -50,6 +50,7 @@ class TermsAndConditionViewController: UIViewController {
@IBOutlet weak var webView: WKWebView!
@IBOutlet weak var agreementButton: UIButton!
// MARK: VC's Life cycle
var isURLLoaded = false
override func viewDidLoad() {
super.viewDidLoad()
@ -57,6 +58,7 @@ class TermsAndConditionViewController: UIViewController {
self.webView.load(URLRequest(url: url))
self.webView.scrollView.bounces = false
self.setup()
self.setWebViewDelegate()
}
// MARK: IBActions
@ -151,3 +153,27 @@ extension TermsAndConditionViewController: TermsAndConditionViewInterface {
}
}
}
extension TermsAndConditionViewController: WKNavigationDelegate, UIScrollViewDelegate {
func setWebViewDelegate() {
webView.scrollView.delegate = self
webView.navigationDelegate = self
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
isURLLoaded = true
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isURLLoaded {
if scrollView.contentOffset.y >= (scrollView.contentSize.height - scrollView.frame.size.height) {
agreementButton.isEnabled = true
} else if scrollView.contentOffset.y < scrollView.contentSize.height {
agreementButton.isEnabled = false
}
}
}
}

13
GME Remit/Utilities/MultiMediaManager.swift

@ -65,7 +65,9 @@ class MultiMediaManager: NSObject {
}
let cancelAction = UIAlertAction(title: "cancel_text".localized(), style: .cancel, handler: nil)
alertController.addAction(cameraAction)
if DevicePlatform.isSimulator {
alertController.addAction(galleryAction)
}
alertController.addAction(cancelAction)
alertController.modalPresentationStyle = .overFullScreen
@ -202,3 +204,14 @@ struct PermissionHelper {
}
}
struct DevicePlatform {
static var isSimulator: Bool {
#if targetEnvironment(simulator)
// We're on the simulator
return true
#else
// We're on a device
return false
#endif
}
}
Loading…
Cancel
Save