-
-
Notifications
You must be signed in to change notification settings - Fork 286
/
Copy pathBasicViewController.swift
31 lines (25 loc) · 964 Bytes
/
BasicViewController.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
import UIKit
import ImageViewer_swift
class BasicViewController:UIViewController {
lazy var imageView:UIImageView = {
let iv = UIImageView()
iv.image = Data.images[0]
// Setup Image Viewer
iv.setupImageViewer()
return iv
}()
override func loadView() {
super.loadView()
view = UIView()
view.backgroundColor = .white
view.addSubview(imageView)
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor, constant: 20).isActive = true
imageView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 20).isActive = true
imageView.widthAnchor.constraint(equalToConstant: 100).isActive = true
imageView.heightAnchor.constraint(equalToConstant: 100).isActive = true
}
override func viewDidLoad() {
super.viewDidLoad()
}
}