Rename isSendButtonEnabledForInputBar -> shouldEnableSendButton

This commit is contained in:
Igor Kashkuta 2016-04-13 15:59:33 +01:00
parent 3b449b352f
commit 9b4232bcb3
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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
}