@@ -32,7 +32,8 @@ final class IssuesViewController:
3232 IssueNeckLoadSectionControllerDelegate ,
3333 FlatCacheListener ,
3434 IssueCommentSectionControllerDelegate ,
35- IssueTextActionsViewSendDelegate {
35+ IssueTextActionsViewSendDelegate ,
36+ MessageTextViewListener {
3637
3738 private let client : GithubClient
3839 private let model : IssueDetailsModel
@@ -50,6 +51,7 @@ final class IssuesViewController:
5051
5152 private var needsScrollToBottom = false
5253 private var lastTimelineElement : ListDiffable ?
54+ private var actions : IssueTextActionsView ?
5355
5456 // must fetch collaborator info from API before showing editing controls
5557 private var viewerIsCollaborator = false
@@ -183,6 +185,10 @@ final class IssuesViewController:
183185 // text input bar uses UIVisualEffectView, don't try to match it
184186 actions. backgroundColor = . clear
185187 actions. sendDelegate = self
188+ self . actions = actions
189+
190+ actions. sendButtonEnabled = !messageView. textView. text. isEmpty
191+ messageView. textView. add ( listener: self )
186192
187193 textActionsController. configure ( client: client, textView: messageView. textView, actions: actions)
188194 textActionsController. viewController = self
@@ -600,4 +606,13 @@ final class IssuesViewController:
600606 }
601607 }
602608
609+ // MARK: MessageTextViewListener
610+
611+ func didChange( textView: MessageTextView ) {
612+ actions? . sendButtonEnabled = !textView. text. isEmpty
613+ }
614+
615+ func didChangeSelection( textView: MessageTextView ) { }
616+ func willChangeRange( textView: MessageTextView , to range: NSRange ) { }
617+
603618}
0 commit comments