Skip to content

Instantly share code, notes, and snippets.

View ioskevinshah's full-sized avatar

Kevin Shah ioskevinshah

View GitHub Profile
var imgVDropDown: UIImageView = {
var imgV: UIImageView = UIImageView(image: UIImage(named: "ic_dropDown")?.withRenderingMode(.alwaysTemplate))
imgV.tintColor = .blue
return imgV
}()
fileprivate var horizontalStackView: UIStackView = {
let stackView: UIStackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.isUserInteractionEnabled = false
stackView.alignment = .center
stackView.axis = .horizontal
stackView.distribution = .equalCentering
stackView.spacing = 4
return stackView
}()
fileprivate func addSubView() {
verticalStackView.addArrangedSubview(lblTitle)
verticalStackView.addArrangedSubview(lblSubTitle)
horizontalStackView.addArrangedSubview(verticalStackView)
horizontalStackView.addArrangedSubview(imgVDropDown)
addSubview(horizontalStackView)
}
/// NavigationTitleDropDownButton
class NavigationTitleDropDownButton: UIButton {
/// Variable Declaration(s)
var lblTitle: UILabel = {
var lbl: UILabel = UILabel()
lbl.translatesAutoresizingMaskIntoConstraints = false
lbl.backgroundColor = .clear
lbl.textAlignment = .center
lbl.adjustsFontSizeToFitWidth = true