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.

71 lines
2.1 KiB

5 years ago
  1. //
  2. // BiometricAuthenticationNotificationViewController.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon Devik Kim on 30/04/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class BiometricAuthenticationNotificationViewController: UIViewController {
  10. // MARK: Properties
  11. var presenter: BiometricAuthenticationNotificationModuleInterface?
  12. // MARK: IBOutlets
  13. @IBOutlet weak var useBiometricAuthButton: UIButton!
  14. @IBOutlet weak var usePasswordButton: UIButton!
  15. @IBOutlet weak var titleLabel: UILabel!
  16. @IBOutlet weak var contentLabel: UILabel!
  17. @IBOutlet weak var manualLabel: UILabel!
  18. // MARK: VC's Life cycle
  19. override func viewDidLoad() {
  20. super.viewDidLoad()
  21. self.setup()
  22. }
  23. // MARK: IBActions
  24. @IBAction func touchUseBiometricAuth(_ sender: UIButton) {
  25. BiometricAuthenticationWireframe().showBiometricAuthentication() { error in
  26. if error != nil {
  27. self.alert(type: .error, message: error!.message)
  28. } else {
  29. KeyChain.shared.save(data: "1", key: .biometricAuth)
  30. self.dismiss(animated: true, completion: nil)
  31. }
  32. }
  33. }
  34. @IBAction func touchUsePassword(_ sender: UIButton) {
  35. KeyChain.shared.save(data: "0", key: .biometricAuth)
  36. self.dismiss(animated: true, completion: nil)
  37. }
  38. // MARK: Other Functions
  39. private func setup() {
  40. // all setup should be done here
  41. useBiometricAuthButton.layer.cornerRadius = 5
  42. usePasswordButton.layer.cornerRadius = 5
  43. setMultiLanguage()
  44. }
  45. private func setMultiLanguage() {
  46. titleLabel.text = "biometric_noti_title_text".localized()
  47. contentLabel.text = "biometric_noti_content_text".localized()
  48. manualLabel.text = "biometric_noti_manual_text".localized()
  49. useBiometricAuthButton.setTitle("biometric_noti_biometric_use_button_text".localized(), for: .normal)
  50. usePasswordButton.setTitle("biometric_noti_password_use_button_text".localized(), for: .normal)
  51. }
  52. }
  53. // MARK: BiometricAuthenticationNotificationViewInterface
  54. extension BiometricAuthenticationNotificationViewController: BiometricAuthenticationNotificationViewInterface {
  55. }