diff --git a/ChattoAdditions/Source/Input/ChatInputItem.swift b/ChattoAdditions/Source/Input/ChatInputItem.swift index 11b928d..bad9389 100644 --- a/ChattoAdditions/Source/Input/ChatInputItem.swift +++ b/ChattoAdditions/Source/Input/ChatInputItem.swift @@ -31,7 +31,7 @@ public enum ChatInputItemPresentationMode: UInt { } public protocol ChatInputItemProtocol: AnyObject { - var tabView: UIView { get } + var inputButton: ChatInputButton { get } var inputView: UIView? { get } var presentationMode: ChatInputItemPresentationMode { get } var showsSendButton: Bool { get } diff --git a/ChattoAdditions/Source/Input/ChatInputItemView.swift b/ChattoAdditions/Source/Input/ChatInputItemView.swift index 2badb0c..8cd975b 100644 --- a/ChattoAdditions/Source/Input/ChatInputItemView.swift +++ b/ChattoAdditions/Source/Input/ChatInputItemView.swift @@ -53,12 +53,12 @@ class ChatInputItemView: UIView { var inputItem: ChatInputItemProtocol! { willSet { if self.inputItem != nil { - self.inputItem.tabView.removeFromSuperview() + self.inputItem.inputButton.removeFromSuperview() } } didSet { if self.inputItem != nil { - self.addSubview(self.inputItem.tabView) + self.addSubview(self.inputItem.inputButton) self.setNeedsLayout() } } @@ -69,10 +69,10 @@ class ChatInputItemView: UIView { extension ChatInputItemView { override func layoutSubviews() { super.layoutSubviews() - self.inputItem.tabView.frame = self.bounds + self.inputItem.inputButton.frame = self.bounds } override func intrinsicContentSize() -> CGSize { - return self.inputItem.tabView.intrinsicContentSize() + return self.inputItem.inputButton.intrinsicContentSize() } } diff --git a/ChattoAdditions/Source/Input/Photos/PhotosChatInputItem.swift b/ChattoAdditions/Source/Input/Photos/PhotosChatInputItem.swift index d7f75c0..b671a2b 100644 --- a/ChattoAdditions/Source/Input/Photos/PhotosChatInputItem.swift +++ b/ChattoAdditions/Source/Input/Photos/PhotosChatInputItem.swift @@ -47,7 +47,7 @@ public class PhotosChatInputItem: ChatInputItemProtocol { return ChatInputButtonAppearance(images: images, size: nil) } - lazy private var internalTabView: UIButton = { + lazy private var internalInputButton: ChatInputButton = { return ChatInputButton.makeInputButton(withAppearance: self.buttonAppearance) }() @@ -59,7 +59,7 @@ public class PhotosChatInputItem: ChatInputItemProtocol { public var selected = false { didSet { - self.internalTabView.selected = self.selected + self.internalInputButton.selected = self.selected } } @@ -77,8 +77,8 @@ public class PhotosChatInputItem: ChatInputItemProtocol { return self.photosInputView as? UIView } - public var tabView: UIView { - return self.internalTabView + public var inputButton: ChatInputButton { + return self.internalInputButton } public func handleInput(input: AnyObject) { diff --git a/ChattoAdditions/Source/Input/Text/TextChatInputItem.swift b/ChattoAdditions/Source/Input/Text/TextChatInputItem.swift index feeac04..9128754 100644 --- a/ChattoAdditions/Source/Input/Text/TextChatInputItem.swift +++ b/ChattoAdditions/Source/Input/Text/TextChatInputItem.swift @@ -42,13 +42,14 @@ public class TextChatInputItem { return ChatInputButtonAppearance(images: images, size: nil) } - lazy private var internalTabView: ChatInputButton = { + lazy private var internalInputButton: ChatInputButton = { return ChatInputButton.makeInputButton(withAppearance: self.buttonAppearance) }() + // Move to protocol extension public var selected = false { didSet { - self.internalTabView.selected = self.selected + self.internalInputButton.selected = self.selected } } } @@ -67,8 +68,8 @@ extension TextChatInputItem : ChatInputItemProtocol { return nil } - public var tabView: UIView { - return self.internalTabView + public var inputButton: ChatInputButton { + return self.internalInputButton } public func handleInput(input: AnyObject) {