// // AccountControllerAbout.swift // Wallet // // Created by Saveliy Stavitsky on 3/12/21. // Copyright © 2021 AM. All rights reserved. // import UIKit import WebKit import WalletFoundation class AccountControllerAbout: UIViewController { @IBOutlet private var descriptionLabel: UILabel! init() { super.init(nibName: "AccountControllerAbout", bundle: nil) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() title = L10n.Account.Settings.About.title navigationItem.leftBarButtonItem = .pop(self) self.localizeView() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.setNavigationBarHidden(false, animated: true) } @IBAction func malinkaPressed(_ sender: Any) { URL(string: "https://malinka.life/") >>- { UIApplication.shared.open($0) } } private func localizeView() { if let url = Bundle.main.url(forResource: L10n.Account.Settings.About.html, withExtension: nil), let rawString = try? String(contentsOf: url), let htmlData = rawString.data(using: .utf8), let attributedString = try? NSAttributedString(data: htmlData, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) { self.descriptionLabel.attributedText = attributedString } } }