You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/SignalUtilitiesKit/Utilities/UIViewController+Utilities....

27 lines
961 B
Swift

import SessionUIKit
4 years ago
@objc(LKViewControllerUtilities)
public final class ViewControllerUtilities: NSObject {
4 years ago
private override init() { }
4 years ago
@objc(setUpDefaultSessionStyleForVC:withTitle:customBackButton:)
4 years ago
public static func setUpDefaultSessionStyle(for vc: UIViewController, title: String?, hasCustomBackButton: Bool) {
4 years ago
// Customize title
4 years ago
if let title = title {
let titleLabel = UILabel()
titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
titleLabel.text = title
titleLabel.themeTextColor = .textPrimary
4 years ago
vc.navigationItem.titleView = titleLabel
}
4 years ago
// Set up back button
4 years ago
if hasCustomBackButton {
let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
backButton.themeTintColor = .textPrimary
4 years ago
vc.navigationItem.backBarButtonItem = backButton
}
4 years ago
}
}