2 // AboutViewController.swift
5 // Created by Pawel Dabrowski on 18/09/2018.
6 // Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
12 class AboutViewController: MainViewController, MFMailComposeViewControllerDelegate {
14 @IBOutlet weak var firstTextView: UITextView!
15 @IBOutlet weak var secondLabel: UILabel!
16 @IBOutlet weak var thirdLabel: UILabel!
17 @IBOutlet weak var contactButton: UIButton!
18 @IBOutlet weak var becomeFriendButton: UIButton!
19 @IBOutlet weak var logoTopConstraint: NSLayoutConstraint!
21 override func viewDidLoad() {
24 title = "nav_about".localized
26 firstTextView.textContainerInset = UIEdgeInsets.zero
27 firstTextView.textContainer.lineFragmentPadding = 0
29 becomeFriendButton.layer.cornerRadius = 18
31 if DatabaseManager.shared.isUserPremium() || Constants.donateEnabled == false{
32 becomeFriendButton.isHidden = true
33 logoTopConstraint.constant = 30
36 becomeFriendButton.isHidden = false
37 logoTopConstraint.constant = 70
41 if let htmlString = try? NSAttributedString(html: "about_text".localized){
42 firstTextView.attributedText = htmlString
45 firstTextView.text = "about_text".localized
47 firstTextView.tintColor = Constants.Colors.darkGreenBgColor()
49 secondLabel.text = "about_text_fundation".localized
50 thirdLabel.text = "about_text_mkdn".localized
51 contactButton.text = "about_text_contact".localized
54 @IBAction func becomeFriendButtonAction(_ sender: Any) {
55 onBecomeFriendButtonTapped()
58 @IBAction func contactButtonAction(_ sender: Any) {
60 let email = contactButton.text
61 if let url = URL(string: "mailto:\(email)") {
62 if #available(iOS 10.0, *) {
63 UIApplication.shared.open(url)
65 UIApplication.shared.openURL(url)