diff --git a/ChattoAdditions/Source/Input/ChatInputBar.swift b/ChattoAdditions/Source/Input/ChatInputBar.swift index 7b42c1c..1f75041 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 updateSendButtonEnabledState = { (inputBar: ChatInputBar) -> Bool in + public var isSendButtonEnabledForInputBar = { (inputBar: ChatInputBar) -> Bool in return !inputBar.textView.text.isEmpty } @@ -154,7 +154,7 @@ public class ChatInputBar: ReusableXibView { } private func updateSendButton() { - self.sendButton.enabled = self.updateSendButtonEnabledState(self) + self.sendButton.enabled = self.isSendButtonEnabledForInputBar(self) } @IBAction func buttonTapped(sender: AnyObject) { diff --git a/ChattoAdditions/Tests/Input/ChatInputBarTests.swift b/ChattoAdditions/Tests/Input/ChatInputBarTests.swift index b739fb3..7a8490d 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.updateSendButtonEnabledState = { (_) in + self.bar.isSendButtonEnabledForInputBar = { (_) in closureCalled = true return false }