-
Notifications
You must be signed in to change notification settings - Fork 1
/
DetailViewController.swift
38 lines (30 loc) · 1016 Bytes
/
DetailViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// DetailViewController.swift
// StormViewer
//
// Created by Julian Moorhouse on 04/07/2019.
// Copyright © 2019 Mindwarp Consultancy Ltd. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
@IBOutlet var imageView: UIImageView!
var selectedImage: String?
var selectedPictureNumber = 0
var totalPictures = 0
override func viewDidLoad() {
super.viewDidLoad()
title = "Picture \(selectedPictureNumber) of \(totalPictures)"
navigationItem.largeTitleDisplayMode = .never
if let imageToLoad = selectedImage {
imageView.image = UIImage(named: imageToLoad)
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.hidesBarsOnTap = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.hidesBarsOnTap = false
}
}