From 9b4232bcb3c81e4ff1f995266a3ec2438ed6476a Mon Sep 17 00:00:00 2001 From: Igor Kashkuta Date: Wed, 13 Apr 2016 15:59:33 +0100 Subject: [PATCH] Rename isSendButtonEnabledForInputBar -> shouldEnableSendButton --- ChattoAdditions/Source/Input/ChatInputBar.swift | 4 ++-- ChattoAdditions/Tests/Input/ChatInputBarTests.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 }