Rename isSendButtonEnabledForInputBar -> shouldEnableSendButton
This commit is contained in:
parent
3b449b352f
commit
9b4232bcb3
|
|
@ -38,7 +38,7 @@ public class ChatInputBar: ReusableXibView {
|
|||
public weak var delegate: ChatInputBarDelegate?
|
||||
weak var presenter: ChatInputBarPresenter?
|
||||
|
||||
public var isSendButtonEnabledForInputBar = { (inputBar: ChatInputBar) -> Bool in
|
||||
public var shouldEnableSendButton = { (inputBar: ChatInputBar) -> Bool in
|
||||
return !inputBar.textView.text.isEmpty
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ public class ChatInputBar: ReusableXibView {
|
|||
}
|
||||
|
||||
private func updateSendButton() {
|
||||
self.sendButton.enabled = self.isSendButtonEnabledForInputBar(self)
|
||||
self.sendButton.enabled = self.shouldEnableSendButton(self)
|
||||
}
|
||||
|
||||
@IBAction func buttonTapped(sender: AnyObject) {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class ChatInputBarTests: XCTestCase {
|
|||
|
||||
func testThat_WhenInputTextChangedAndCustomStateUpdateClosureProvided_BarUpdatesSendButtonStateAccordingly() {
|
||||
var closureCalled = false
|
||||
self.bar.isSendButtonEnabledForInputBar = { (_) in
|
||||
self.bar.shouldEnableSendButton = { (_) in
|
||||
closureCalled = true
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue