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.
72 lines
1.7 KiB
72 lines
1.7 KiB
//
|
|
// AppUpdateViewController.swift
|
|
// GME Remit
|
|
//
|
|
// Created by shishir sapkota on 12/11/18.
|
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class AppUpdateViewController: UIViewController {
|
|
|
|
// MARK: Properties
|
|
@IBOutlet weak var updateButton: UIButton!
|
|
|
|
@IBOutlet weak var notNowButton: UIButton!
|
|
var presenter: AppUpdateModuleInterface?
|
|
|
|
// MARK: IBOutlets
|
|
|
|
// MARK: VC's Life cycle
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
self.setup()
|
|
}
|
|
|
|
// MARK: IBActions
|
|
|
|
@IBAction func dismiss(_ sender: Any) {
|
|
self.dismiss()
|
|
}
|
|
|
|
@IBAction func update(_ sender: UIButton) {
|
|
self.update()
|
|
}
|
|
|
|
// MARK: Other Functions
|
|
|
|
private func setup() {
|
|
let shouldHideDismiss = Utility.isCriticalUpdate()
|
|
self.notNowButton.isHidden = shouldHideDismiss
|
|
configureUpdateButton()
|
|
}
|
|
|
|
func configureUpdateButton() {
|
|
self.updateButton.layer.borderColor = UIColor.white.cgColor
|
|
self.updateButton.layer.borderWidth = 1
|
|
|
|
self.updateButton.layer.addShadow(offset: CGSize.init(width: -1, height: 1))
|
|
|
|
}
|
|
|
|
func dismiss() {
|
|
self.dismiss(animated: true, completion: nil)
|
|
}
|
|
|
|
func update() {
|
|
let urlStr = "itms://itunes.apple.com/gh/app/gme-remit/id1439161261?mt=8"
|
|
if #available(iOS 10.0, *) {
|
|
UIApplication.shared.open(URL(string: urlStr)!, options: [:], completionHandler: nil)
|
|
|
|
} else {
|
|
UIApplication.shared.openURL(URL(string: urlStr)!)
|
|
}
|
|
}
|
|
}
|
|
|
|
// MARK: AppUpdateViewInterface
|
|
extension AppUpdateViewController: AppUpdateViewInterface {
|
|
|
|
}
|