diff --git a/enzevalos_iphone/IntroSecretViewController.swift b/enzevalos_iphone/IntroSecretViewController.swift index e7769793e7a32e6facace9cda4702f8d413fe076..fbcc0a373d52764b65bfba6b459b5d6e31bf9f44 100644 --- a/enzevalos_iphone/IntroSecretViewController.swift +++ b/enzevalos_iphone/IntroSecretViewController.swift @@ -16,6 +16,7 @@ class IntroSecretViewController: UIViewController, IntroInfoButton { var descriptionText: String = "" + var alternateText: String? var secretText = "" var useTextView = false var doneText = NSLocalizedString("Done", comment: "finish action") @@ -29,7 +30,7 @@ class IntroSecretViewController: UIViewController, IntroInfoButton { static let storyboardID = "secretViewController" - static func storyboardInstance(description: String, secret: String, doneAction: ((_ sender: Any) -> ())? = nil, doneText: String = NSLocalizedString("Done", comment: "finish action"), titleText: String = "", titleDecription: String = "", titleAction: ((_ sender: Any) -> ())? = nil, url: String? = TravelHandler.website, titleImage: UIImage? = TravelHandler.planeIcon) -> IntroSecretViewController? { + static func storyboardInstance(description: String, secret: String, doneAction: ((_ sender: Any) -> ())? = nil, doneText: String = NSLocalizedString("Done", comment: "finish action"), titleText: String = "", titleDecription: String = "", titleAction: ((_ sender: Any) -> ())? = nil, url: String? = TravelHandler.website, titleImage: UIImage? = TravelHandler.planeIcon, alternateText: String? = nil) -> IntroSecretViewController? { let storyboard = UIStoryboard(name: "Intro", bundle: nil) if let controller = storyboard.instantiateViewController(withIdentifier: storyboardID) as? IntroSecretViewController { @@ -46,6 +47,7 @@ class IntroSecretViewController: UIViewController, IntroInfoButton { } controller.url = url controller.titleImage = titleImage + controller.alternateText = alternateText return controller } return nil @@ -88,6 +90,10 @@ class IntroSecretViewController: UIViewController, IntroInfoButton { //getting the input values from user if let textFields = alertController.textFields, let writtenSecret = textFields[0].text, writtenSecret == self.secretText { equalAction() + } else { + if !self.useTextView { + self.descriptionLabel.text = self.alternateText + } }