mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add Account scenes should have account graphic in header. Issue #1305
This commit is contained in:
36
iOS/UIKit Extensions/ImageHeaderView.swift
Normal file
36
iOS/UIKit Extensions/ImageHeaderView.swift
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// ImageHeaderView.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/3/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ImageHeaderView: UITableViewHeaderFooterView {
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user