forked from zelo72/mastodon-ios
fix: inputAssistantItem duplicate setup issue
This commit is contained in:
parent
8f2e789183
commit
10eae495e4
|
@ -684,14 +684,15 @@ extension ComposeViewController {
|
|||
|
||||
// keyboard shortcutBar
|
||||
private func setupInputAssistantItem(item: UITextInputAssistantItem) {
|
||||
let groups = [UIBarButtonItemGroup(barButtonItems: [
|
||||
let barButtonItems = [
|
||||
composeToolbarView.mediaBarButtonItem,
|
||||
composeToolbarView.pollBarButtonItem,
|
||||
composeToolbarView.contentWarningBarButtonItem,
|
||||
composeToolbarView.visibilityBarButtonItem,
|
||||
], representativeItem: nil)]
|
||||
]
|
||||
let group = UIBarButtonItemGroup(barButtonItems: barButtonItems, representativeItem: nil)
|
||||
|
||||
item.trailingBarButtonGroups = groups
|
||||
item.trailingBarButtonGroups = [group]
|
||||
}
|
||||
|
||||
private func configureToolbarDisplay(keyboardHasShortcutBar: Bool) {
|
||||
|
@ -770,15 +771,6 @@ extension ComposeViewController: UITextViewDelegate {
|
|||
return true
|
||||
}
|
||||
|
||||
func textViewDidBeginEditing(_ textView: UITextView) {
|
||||
switch textView {
|
||||
case textEditorView.textView:
|
||||
setupInputAssistantItem(item: textView.inputAssistantItem)
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
}
|
||||
|
||||
func textViewDidChange(_ textView: UITextView) {
|
||||
switch textView {
|
||||
case textEditorView.textView:
|
||||
|
|
Loading…
Reference in New Issue