Я настраиваю SFSafariViewController
в моем DetailVC.Где мне нужно настроить кодирование для устранения ошибки:
Использование неразрешенного идентификатора SafariVC
Ошибка отображается рядом с: safariVC.delegate = self
.
import SafariServices
import UIKit
class StateDetailViewController: UIViewController, SFSafariViewControllerDelegate {
@IBAction func watchButtonTapped(_ sender: SAButton) {
if let url = URL(string: self.state!.url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
let safariVC = SFSafariViewController(url: url)
present(safariVC, animated: true)
}
safariVC.delegate = self
}
@IBOutlet weak var stateTitleTextLabel: UILabel!
@IBOutlet weak var stateDetailTextTitleLabel: UILabel!
@IBOutlet weak var stateDescriptionTextView: UITextView!
var state: State?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
title = "Reciprocal Details"
stateTitleTextLabel.text = state?.title
stateDetailTextTitleLabel.text = state?.detailText
stateDescriptionTextView.text = state?.description
func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
controller.dismiss(animated: true, completion: nil)
}
}
}