46 lines
1.5 KiB
Swift
46 lines
1.5 KiB
Swift
//
|
|
// AccountControllerAbout.swift
|
|
// PayCash
|
|
//
|
|
// Created by Saveliy Stavitsky on 3/12/21.
|
|
// Copyright © 2021 AM. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import WebKit
|
|
|
|
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 paycashPressed(_ sender: Any) {
|
|
UIApplication.shared.open(URL(string: "https://malinka.life/")!)
|
|
}
|
|
|
|
private func localizeView() {
|
|
if let html = (try? String(contentsOf: Bundle.main.url(forResource: L10n.Account.Settings.About.html,
|
|
withExtension: nil)!))?.data(using: .utf8),
|
|
let attributedString = try? NSAttributedString(data: html,
|
|
options: [.documentType: NSAttributedString.DocumentType.html],
|
|
documentAttributes: nil) {
|
|
self.descriptionLabel.attributedText = attributedString
|
|
}
|
|
}
|
|
|
|
}
|