// // UINavigationItem+Extensions.swift // CapCollector // // Created by Christoph on 12.05.20. // Copyright © 2020 CH. All rights reserved. // import UIKit extension UINavigationItem { func setTitle(_ title: String, subtitle: String) { let titleLabel = UILabel() titleLabel.text = title titleLabel.font = .systemFont(ofSize: 17.0) titleLabel.textColor = .black let subtitleLabel = UILabel() subtitleLabel.text = subtitle subtitleLabel.font = .systemFont(ofSize: 12.0) subtitleLabel.textColor = .gray let stackView = UIStackView(arrangedSubviews: [titleLabel, subtitleLabel]) stackView.distribution = .equalCentering stackView.alignment = .center stackView.axis = .vertical self.titleView = stackView } }