mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-30 17:14:51 +01:00
fix: iPad navigation bar still could be large title issue
This commit is contained in:
parent
2b2707c600
commit
4d03e114ca
@ -44,18 +44,20 @@ final class ComposeViewController: UIViewController, NeedsDependency {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
private(set) lazy var cancelBarButtonItem = UIBarButtonItem(title: L10n.Common.Controls.Actions.cancel, style: .plain, target: self, action: #selector(ComposeViewController.cancelBarButtonItemPressed(_:)))
|
private(set) lazy var cancelBarButtonItem = UIBarButtonItem(title: L10n.Common.Controls.Actions.cancel, style: .plain, target: self, action: #selector(ComposeViewController.cancelBarButtonItemPressed(_:)))
|
||||||
let characterCountLabel: UILabel = {
|
|
||||||
let label = UILabel()
|
// FIXME: deprecated
|
||||||
label.font = .systemFont(ofSize: 15, weight: .regular)
|
// let characterCountLabel: UILabel = {
|
||||||
label.text = "500"
|
// let label = UILabel()
|
||||||
label.textColor = Asset.Colors.Label.secondary.color
|
// label.font = .systemFont(ofSize: 15, weight: .regular)
|
||||||
label.accessibilityLabel = L10n.A11y.Plural.Count.inputLimitRemains(500)
|
// label.text = "500"
|
||||||
return label
|
// label.textColor = Asset.Colors.Label.secondary.color
|
||||||
}()
|
// label.accessibilityLabel = L10n.A11y.Plural.Count.inputLimitRemains(500)
|
||||||
private(set) lazy var characterCountBarButtonItem: UIBarButtonItem = {
|
// return label
|
||||||
let barButtonItem = UIBarButtonItem(customView: characterCountLabel)
|
// }()
|
||||||
return barButtonItem
|
// private(set) lazy var characterCountBarButtonItem: UIBarButtonItem = {
|
||||||
}()
|
// let barButtonItem = UIBarButtonItem(customView: characterCountLabel)
|
||||||
|
// return barButtonItem
|
||||||
|
// }()
|
||||||
|
|
||||||
let publishButton: UIButton = {
|
let publishButton: UIButton = {
|
||||||
let button = RoundedEdgesButton(type: .custom)
|
let button = RoundedEdgesButton(type: .custom)
|
||||||
@ -139,16 +141,6 @@ extension ComposeViewController {
|
|||||||
])
|
])
|
||||||
composeContentViewController.didMove(toParent: self)
|
composeContentViewController.didMove(toParent: self)
|
||||||
|
|
||||||
// bind navigation bar style
|
|
||||||
// configureNavigationBarTitleStyle()
|
|
||||||
viewModel.traitCollectionDidChangePublisher
|
|
||||||
.receive(on: DispatchQueue.main)
|
|
||||||
.sink { [weak self] _ in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.configureNavigationBarTitleStyle()
|
|
||||||
}
|
|
||||||
.store(in: &disposeBag)
|
|
||||||
|
|
||||||
// bind title
|
// bind title
|
||||||
viewModel.$title
|
viewModel.$title
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
@ -226,15 +218,7 @@ extension ComposeViewController {
|
|||||||
// break
|
// break
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
private func configureNavigationBarTitleStyle() {
|
|
||||||
switch traitCollection.userInterfaceIdiom {
|
|
||||||
case .pad:
|
|
||||||
navigationController?.navigationBar.prefersLargeTitles = traitCollection.horizontalSizeClass == .regular
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user