Skip to content

Instantly share code, notes, and snippets.

@olxios
Created June 5, 2016 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olxios/7b5bbe9fc5268fd963c7db0c30014482 to your computer and use it in GitHub Desktop.
Save olxios/7b5bbe9fc5268fd963c7db0c30014482 to your computer and use it in GitHub Desktop.
import UIKit
class PageItemController: UIViewController {
// MARK: - Variables
// ***
var itemIndex: Int = 0
// ***
var imageName: String = "" {
didSet {
if let imageView = contentImageView {
imageView.image = UIImage(named: imageName)
}
}
}
@IBOutlet var contentImageView: UIImageView?
// MARK: - View Lifecycle
// ***
override func viewDidLoad() {
super.viewDidLoad()
contentImageView!.image = UIImage(named: imageName)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment