TabInputButton renamed to ChatInputButton for consistency

This commit is contained in:
Anton Schukin 2016-07-26 17:34:57 +01:00
parent d8a162cb0f
commit 3fa9853321
4 changed files with 21 additions and 21 deletions

View File

@ -77,7 +77,7 @@
C3C0CC8B1BFE49700052747C /* PhotosInputViewItemSizeCalculatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C0CC7D1BFE49700052747C /* PhotosInputViewItemSizeCalculatorTests.swift */; };
C3C0CC8C1BFE49700052747C /* TextChatInputItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C0CC7E1BFE49700052747C /* TextChatInputItemTests.swift */; };
C3C0CC8D1BFE49700052747C /* ObservableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C0CC7F1BFE49700052747C /* ObservableTests.swift */; };
C3C9BC8F1D11540D00F3A54E /* TabInputButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C9BC8E1D11540D00F3A54E /* TabInputButton.swift */; };
C3C9BC8F1D11540D00F3A54E /* ChatInputButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C9BC8E1D11540D00F3A54E /* ChatInputButton.swift */; };
C3EFA6B01C03607A0063CE22 /* BaseMessagePresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3EFA6AF1C03607A0063CE22 /* BaseMessagePresenterTests.swift */; };
CA073E791C47F5B9009D5EBF /* Chatto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA073E781C47F5B9009D5EBF /* Chatto.framework */; };
F6D04BA71CA46C0200E803FA /* PhotosInputPlaceholderDataProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6D04BA61CA46C0200E803FA /* PhotosInputPlaceholderDataProviderTests.swift */; };
@ -168,7 +168,7 @@
C3C0CC7E1BFE49700052747C /* TextChatInputItemTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextChatInputItemTests.swift; sourceTree = "<group>"; };
C3C0CC7F1BFE49700052747C /* ObservableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObservableTests.swift; sourceTree = "<group>"; };
C3C0CC961BFE4A2A0052747C /* ChattoAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChattoAdditions.h; sourceTree = "<group>"; };
C3C9BC8E1D11540D00F3A54E /* TabInputButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabInputButton.swift; sourceTree = "<group>"; };
C3C9BC8E1D11540D00F3A54E /* ChatInputButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatInputButton.swift; sourceTree = "<group>"; };
C3EFA6AF1C03607A0063CE22 /* BaseMessagePresenterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseMessagePresenterTests.swift; sourceTree = "<group>"; };
CA073E781C47F5B9009D5EBF /* Chatto.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Chatto.framework; path = "../../../../Library/Developer/Xcode/DerivedData/Chatto-gyrilfusfbpmohajjvmmctphuabr/Build/Products/Debug-iphoneos/Chatto.framework"; sourceTree = "<group>"; };
F6D04BA61CA46C0200E803FA /* PhotosInputPlaceholderDataProviderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosInputPlaceholderDataProviderTests.swift; sourceTree = "<group>"; };
@ -332,13 +332,13 @@
C3C0CC051BFE496A0052747C /* ChatInputBar.xib */,
C3C0CC061BFE496A0052747C /* ChatInputBarAppearance.swift */,
C3C0CC071BFE496A0052747C /* ChatInputBarPresenter.swift */,
C3C9BC8E1D11540D00F3A54E /* ChatInputButton.swift */,
C3C0CC081BFE496A0052747C /* ChatInputItem.swift */,
C3C0CC091BFE496A0052747C /* ChatInputItemView.swift */,
C3C0CC0A1BFE496A0052747C /* ExpandableTextView.swift */,
C3C0CC0B1BFE496A0052747C /* HorizontalStackScrollView.swift */,
C3C0CC0C1BFE496A0052747C /* Photos */,
C3C0CC161BFE496A0052747C /* ReusableXibView.swift */,
C3C9BC8E1D11540D00F3A54E /* TabInputButton.swift */,
C3C0CC171BFE496A0052747C /* Text */,
);
path = Input;
@ -573,7 +573,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C3C9BC8F1D11540D00F3A54E /* TabInputButton.swift in Sources */,
C3C9BC8F1D11540D00F3A54E /* ChatInputButton.swift in Sources */,
C3C0CC311BFE496A0052747C /* ChatItemDecorationAttributes.swift in Sources */,
C3C0CC3B1BFE496A0052747C /* PhotoMessageCollectionViewCellDefaultStyle.swift in Sources */,
C38658B21BFE55620012F181 /* AnimationUtils.swift in Sources */,

View File

@ -24,7 +24,7 @@
import Foundation
public struct TabInputButtonAppearance {
public struct ChatInputButtonAppearance {
public var images: [UIControlState: UIImage]
public var size: CGSize?
@ -34,11 +34,11 @@ public struct TabInputButtonAppearance {
}
}
public class TabInputButton: UIButton {
public class ChatInputButton: UIButton {
static public func makeInputButton(withAppearance appearance: TabInputButtonAppearance) -> TabInputButton {
static public func makeInputButton(withAppearance appearance: ChatInputButtonAppearance) -> ChatInputButton {
let images = appearance.images
let button = TabInputButton(type: .Custom)
let button = ChatInputButton(type: .Custom)
button.exclusiveTouch = true
images.forEach { (state, image) in
button.setImage(image, forState: state)

View File

@ -32,23 +32,23 @@ public class PhotosChatInputItem: ChatInputItemProtocol {
public var photosPermissionHandler: (() -> Void)?
public weak var presentingController: UIViewController?
let buttonAppearance: TabInputButtonAppearance
public init(presentingController: UIViewController?, tabInputButtonAppearance: TabInputButtonAppearance = Class.createDefaultButtonAppearance()) {
let buttonAppearance: ChatInputButtonAppearance
public init(presentingController: UIViewController?, buttonAppearance: ChatInputButtonAppearance = Class.createDefaultButtonAppearance()) {
self.presentingController = presentingController
self.buttonAppearance = tabInputButtonAppearance
self.buttonAppearance = buttonAppearance
}
public class func createDefaultButtonAppearance() -> TabInputButtonAppearance {
public class func createDefaultButtonAppearance() -> ChatInputButtonAppearance {
let images: [UIControlState: UIImage] = [
.Normal: UIImage(named: "camera-icon-unselected", inBundle: NSBundle(forClass: Class.self), compatibleWithTraitCollection: nil)!,
.Selected: UIImage(named: "camera-icon-selected", inBundle: NSBundle(forClass: Class.self), compatibleWithTraitCollection: nil)!,
.Highlighted: UIImage(named: "camera-icon-selected", inBundle: NSBundle(forClass: Class.self), compatibleWithTraitCollection: nil)!
]
return TabInputButtonAppearance(images: images, size: nil)
return ChatInputButtonAppearance(images: images, size: nil)
}
lazy private var internalTabView: UIButton = {
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance)
return ChatInputButton.makeInputButton(withAppearance: self.buttonAppearance)
}()
lazy var photosInputView: PhotosInputViewProtocol = {

View File

@ -28,22 +28,22 @@ public class TextChatInputItem {
typealias Class = TextChatInputItem
public var textInputHandler: ((String) -> Void)?
let buttonAppearance: TabInputButtonAppearance
public init(tabInputButtonAppearance: TabInputButtonAppearance = Class.createDefaultButtonAppearance()) {
self.buttonAppearance = tabInputButtonAppearance
let buttonAppearance: ChatInputButtonAppearance
public init(buttonAppearance: ChatInputButtonAppearance = Class.createDefaultButtonAppearance()) {
self.buttonAppearance = buttonAppearance
}
public class func createDefaultButtonAppearance() -> TabInputButtonAppearance {
public class func createDefaultButtonAppearance() -> ChatInputButtonAppearance {
let images: [UIControlState: UIImage] = [
.Normal: UIImage(named: "text-icon-unselected", inBundle: NSBundle(forClass: TextChatInputItem.self), compatibleWithTraitCollection: nil)!,
.Selected: UIImage(named: "text-icon-selected", inBundle: NSBundle(forClass: TextChatInputItem.self), compatibleWithTraitCollection: nil)!,
.Highlighted: UIImage(named: "text-icon-selected", inBundle: NSBundle(forClass: TextChatInputItem.self), compatibleWithTraitCollection: nil)!
]
return TabInputButtonAppearance(images: images, size: nil)
return ChatInputButtonAppearance(images: images, size: nil)
}
lazy private var internalTabView: TabInputButton = {
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance)
lazy private var internalTabView: ChatInputButton = {
return ChatInputButton.makeInputButton(withAppearance: self.buttonAppearance)
}()
public var selected = false {