This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileprivate func addSubView() { | |
| verticalStackView.addArrangedSubview(lblTitle) | |
| verticalStackView.addArrangedSubview(lblSubTitle) | |
| horizontalStackView.addArrangedSubview(verticalStackView) | |
| horizontalStackView.addArrangedSubview(imgVDropDown) | |
| addSubview(horizontalStackView) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| }() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var imgVDropDown: UIImageView = { | |
| var imgV: UIImageView = UIImageView(image: UIImage(named: "ic_dropDown")?.withRenderingMode(.alwaysTemplate)) | |
| imgV.tintColor = .blue | |
| return imgV | |
| }() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MARK: - Configuartion Related Method(s) | |
| extension NavigationTitleDropDownButton { | |
| func configure(_ title: String, subTitle: String? = nil) { | |
| lblTitle.text = title | |
| lblSubTitle.text = subTitle | |
| lblSubTitle.isHidden = (subTitle?.isEmpty == true) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileprivate func prepareUIView() { | |
| /// Adding SubView(s) | |
| addSubView() | |
| /// Preparing constraint(s) | |
| prepareConstraintForHorizontalStackView() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileprivate func prepareConstraintForHorizontalStackView() { | |
| verticalStackView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true | |
| verticalStackView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true | |
| verticalStackView.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1).isActive = true | |
| verticalStackView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 1).isActive = true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileprivate func addSubView() { | |
| verticalStackView.addArrangedSubview(lblTitle) | |
| verticalStackView.addArrangedSubview(lblSubTitle) | |
| addSubview(verticalStackView) | |
| } |
NewerOlder