tabView renamed to inputButton for consistency

This commit is contained in:
Anton Schukin 2016-07-26 17:50:17 +01:00
parent 3fa9853321
commit a8ba3531b7
4 changed files with 14 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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