2019-11-03 11:01:58 +01:00
|
|
|
//
|
2019-11-16 22:47:12 +01:00
|
|
|
// ImageHeaderView.swift
|
2019-11-03 11:01:58 +01:00
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 11/3/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
2019-11-16 22:47:12 +01:00
|
|
|
class ImageHeaderView: UITableViewHeaderFooterView {
|
2019-11-03 11:01:58 +01:00
|
|
|
|
2019-11-22 22:11:15 +01:00
|
|
|
static let rowHeight = CGFloat(integerLiteral: 88)
|
|
|
|
|
2019-11-03 11:01:58 +01:00
|
|
|
var imageView = UIImageView()
|
|
|
|
|
|
|
|
override init(reuseIdentifier: String?) {
|
|
|
|
super.init(reuseIdentifier: reuseIdentifier)
|
|
|
|
commonInit()
|
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
|
|
|
super.init(coder: coder)
|
|
|
|
commonInit()
|
|
|
|
}
|
|
|
|
|
|
|
|
func commonInit() {
|
|
|
|
imageView.tintColor = UIColor.label
|
|
|
|
imageView.contentMode = .scaleAspectFit
|
|
|
|
addSubview(imageView)
|
|
|
|
}
|
|
|
|
|
|
|
|
override func layoutSubviews() {
|
|
|
|
let x = (bounds.width - 48.0) / 2
|
|
|
|
let y = (bounds.height - 48.0) / 2
|
|
|
|
imageView.frame = CGRect(x: x, y: y, width: 48.0, height: 48.0)
|
|
|
|
}
|
|
|
|
}
|