Small semantic tweak to variable name
This commit is contained in:
parent
731dd6f567
commit
6fe2e695d9
|
@ -11,7 +11,7 @@ import UIKit
|
|||
class DetailViewController: UIViewController {
|
||||
@IBOutlet var imageView: UIImageView!
|
||||
|
||||
var imagePath: String?
|
||||
var selectedImagePath: String?
|
||||
|
||||
override var prefersHomeIndicatorAutoHidden: Bool {
|
||||
get {
|
||||
|
@ -23,7 +23,7 @@ class DetailViewController: UIViewController {
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
title = imagePath
|
||||
title = selectedImagePath
|
||||
navigationItem.largeTitleDisplayMode = .never
|
||||
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
|
@ -32,7 +32,7 @@ class DetailViewController: UIViewController {
|
|||
action: #selector(shareTapped)
|
||||
)
|
||||
|
||||
if let _imagePath = imagePath {
|
||||
if let _imagePath = selectedImagePath {
|
||||
imageView.image = UIImage(named: _imagePath)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class ViewController: UITableViewController {
|
|||
|
||||
if let detailViewController = storyboard?.instantiateViewController(withIdentifier: "Image Detail") as? DetailViewController {
|
||||
// set the vc's `imagePath` property to match the image selected
|
||||
detailViewController.imagePath = imagePaths[indexPath.row]
|
||||
detailViewController.selectedImagePath = imagePaths[indexPath.row]
|
||||
|
||||
// push the detail VC onto the navigation controller
|
||||
navigationController?.pushViewController(detailViewController, animated: true)
|
||||
|
|
Loading…
Reference in New Issue