2020-05-08 17:49:14 +10:00
|
|
|
//
|
|
|
|
// OnboardingStep1aViewController.swift
|
|
|
|
// CovidSafe
|
|
|
|
//
|
|
|
|
// Copyright © 2020 Australian Government. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import KeychainSwift
|
|
|
|
import SafariServices
|
|
|
|
|
|
|
|
class OnboardingStep1aViewController: UIViewController, UITextViewDelegate {
|
|
|
|
|
|
|
|
|
|
|
|
@IBOutlet weak var openLink: UILabel!
|
|
|
|
@IBOutlet weak var privacyText: UITextView!
|
|
|
|
|
|
|
|
@IBAction func iWantToHelpBtnClick(_ sender: UIButton) {
|
|
|
|
UserDefaults.standard.set(true, forKey: "completedIWantToHelp")
|
2020-09-14 11:12:48 +10:00
|
|
|
self.performSegue(withIdentifier: "personalDetailsSegue", sender: self)
|
2020-05-08 17:49:14 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
@IBAction func onBackTapped(_ sender: UIButton) {
|
|
|
|
self.navigationController?.popViewController(animated: true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func displayFAQ() {
|
|
|
|
let nav = HelpNavController()
|
|
|
|
nav.modalTransitionStyle = .coverVertical
|
|
|
|
nav.modalPresentationStyle = .fullScreen
|
|
|
|
present(nav, animated: true, completion: nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
|
|
|
|
if (URL.absoluteString == URLHelper.getHelpURL()) {
|
|
|
|
displayFAQ()
|
|
|
|
} else {
|
|
|
|
let safariVC = SFSafariViewController(url: URL)
|
|
|
|
present(safariVC, animated: true, completion: nil)
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
2020-08-18 10:52:17 +10:00
|
|
|
let privacyPolicyUrl = URLHelper.getPrivacyPolicyURL()
|
2020-05-08 17:49:14 +10:00
|
|
|
privacyText.delegate = self
|
2020-08-18 10:52:17 +10:00
|
|
|
privacyText.addLink(privacyPolicyUrl, enclosedIn: "*")
|
|
|
|
privacyText.addLink(privacyPolicyUrl, enclosedIn: "*")
|
2020-05-08 17:49:14 +10:00
|
|
|
privacyText.addLink(URLHelper.getHelpURL(), enclosedIn: "*")
|
|
|
|
privacyText.addLink("https://www.health.gov.au", enclosedIn: "*")
|
2020-08-18 10:52:17 +10:00
|
|
|
privacyText.addLink(privacyPolicyUrl, enclosedIn: "*")
|
2020-05-08 17:49:14 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|