diff --git a/ChattoAdditions/Source/Input/ChatInputBar.swift b/ChattoAdditions/Source/Input/ChatInputBar.swift index 1f75041..2a346b6 100644 --- a/ChattoAdditions/Source/Input/ChatInputBar.swift +++ b/ChattoAdditions/Source/Input/ChatInputBar.swift @@ -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) { diff --git a/ChattoAdditions/Tests/Input/ChatInputBarTests.swift b/ChattoAdditions/Tests/Input/ChatInputBarTests.swift index 7a8490d..805e9da 100644 --- a/ChattoAdditions/Tests/Input/ChatInputBarTests.swift +++ b/ChattoAdditions/Tests/Input/ChatInputBarTests.swift @@ -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 }