Created
July 8, 2021 14:49
-
-
Save froggomad/da35b3a39ef1871d8f2be4b2d82401f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class InstructionViewController: UIViewController { | |
var titleText: String | |
var instructions: String | |
var image: UIImage | |
var caption: String? | |
var buttonTitle: String | |
lazy var instructionView: InstructionView = { | |
InstructionView(title: titleText, | |
instructions: instructions, | |
image: image, | |
caption: caption, | |
buttonTitle: buttonTitle, | |
target: self, | |
selector: #selector(openSettings) | |
) | |
}() | |
init(title: String, instructions: String, image: UIImage, caption: String? = nil, buttonTitle: String) { | |
self.titleText = title | |
self.instructions = instructions | |
self.image = image | |
self.caption = caption | |
self.buttonTitle = buttonTitle | |
super.init(nibName: nil, bundle: nil) | |
} | |
required init?(coder: NSCoder) { | |
fatalError("programmatic view") | |
} | |
override func loadView() { | |
view = instructionView | |
} | |
@objc private func openSettings() { | |
AppSettingsController.openSettings() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment