// // AlertController.swift // spotTheSpy // // Created by Paolo Alberti on 14/05/18. // Copyright © 2018 Paolo. All rights reserved. // import UIKit class AlertController: UIViewController { @IBOutlet var sfondoView: UIImageView! @IBOutlet var mostraBtn: UIButton! @IBOutlet var viewDesc: UIView! @IBOutlet var descLabel: UILabel! @IBOutlet var mainView: UIView! override func viewDidLoad() { super.viewDidLoad() DataManager.shared.AlertC = self DataManager.shared.cambiaStile(stile: DataManager.shared.stileGrafica) mostraBtn.cornerRadius = 5; mostraBtn.applyGradient(colours: [bluscuro, blu]) mostraBtn.borderWidth = 2 mostraBtn.borderColor = grigio viewDesc.cornerRadius = 5 viewDesc.applyGradient(colours: [grigio, UIColor.white]) viewDesc.borderWidth = 2 viewDesc.borderColor = grigioscuro2 let myNormalAttributedTitle = NSAttributedString(string: NSLocalizedString("Mostrami", comment: ""), attributes: [NSAttributedStringKey.foregroundColor : UIColor.white]) mostraBtn.setAttributedTitle(myNormalAttributedTitle, for: .normal) mostraBtn.titleLabel?.textAlignment = NSTextAlignment.center descLabel.text = NSLocalizedString("Desc_alert", comment: "") // Ridimensiono la schermata delle Opzioni per i diversi Device (NON uso l'Auto Layout) var scale = self.view.frame.size.width/414 if (UIDevice.current.userInterfaceIdiom == .pad) { scale = self.view.frame.size.height/736 } mainView.transform = CGAffineTransform(scaleX: scale, y: scale) } @IBAction func mostra(_ sender: UIButton) { DataManager.shared.lightGen.impactOccurred() Sound.play(file: "page.mp3") } }