Fix an issue where buttons in text overlay toolbar could be too small.

The cause of this issue was that ImageEditorViewController's view was created
with zero dimensions. Those dimensions were then used to pre-calculate size
of the toolbar which ended up being incorrect.

The fix is to let UIKit create the root view and move everything we did in `loadView`
to `viewDidLoad`.
This commit is contained in:
Igor Solomennikov 2022-08-03 17:59:53 -07:00 committed by GitHub
parent 2a738fb459
commit ee2f39d3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,10 +234,8 @@ class ImageEditorViewController: OWSViewController {
model.add(observer: self)
}
override func loadView() {
view = UIView()
override func viewDidLoad() {
view.backgroundColor = .black
view.isOpaque = true
imageEditorView.configureSubviews()
view.addSubview(imageEditorView)
@ -268,10 +266,6 @@ class ImageEditorViewController: OWSViewController {
strokeWidthSliderPosition = strokeWidthSliderContainer.centerXAnchor.constraint(equalTo: view.leadingAnchor)
strokeWidthSliderPosition?.autoInstall()
strokeWidthSliderContainer.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleSliderContainerTap(_:))))
}
override func viewDidLoad() {
super.viewDidLoad()
updateUIForCurrentMode()
}