-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageCollectionViewCell.swift
More file actions
executable file
·53 lines (37 loc) · 1.03 KB
/
ImageCollectionViewCell.swift
File metadata and controls
executable file
·53 lines (37 loc) · 1.03 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// ImageCollectionViewCell.swift
// ImagePickerSheet
//
// Created by Laurin Brandner on 06/09/14.
// Copyright (c) 2014 Laurin Brandner. All rights reserved.
//
import UIKit
class ImageCollectionViewCell : UICollectionViewCell {
let imageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .ScaleAspectFill
return imageView
}()
// MARK: - Initialization
override init(frame: CGRect) {
super.init(frame: frame)
initialize()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initialize()
}
private func initialize() {
addSubview(imageView)
}
// MARK: - Other Methods
override func prepareForReuse() {
super.prepareForReuse()
imageView.image = nil
}
// MARK: - Layout
override func layoutSubviews() {
super.layoutSubviews()
imageView.frame = bounds
}
}