TabInputButton accessibilityId introduced (#206)

* TabInputButton accessibilityId introduced

* TabInputButton accessibilityId introduced
This commit is contained in:
geegaset 2016-08-23 11:48:13 +01:00 committed by Diego Sánchez
parent 22a3833761
commit b98c487643
3 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public class PhotosChatInputItem: ChatInputItemProtocol {
}
lazy private var internalTabView: UIButton = {
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance)
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance, accessibilityID: "photos.chat.input.view")
}()
lazy var photosInputView: PhotosInputViewProtocol = {

View File

@ -36,13 +36,16 @@ public struct TabInputButtonAppearance {
public class TabInputButton: UIButton {
static public func makeInputButton(withAppearance appearance: TabInputButtonAppearance) -> TabInputButton {
static public func makeInputButton(withAppearance appearance: TabInputButtonAppearance, accessibilityID: String? = nil) -> TabInputButton {
let images = appearance.images
let button = TabInputButton(type: .Custom)
button.exclusiveTouch = true
images.forEach { (state, image) in
button.setImage(image, forState: state.controlState)
}
if let accessibilityIdentifier = accessibilityID {
button.accessibilityIdentifier = accessibilityIdentifier
}
button.size = appearance.size
return button
}

View File

@ -43,7 +43,7 @@ public class TextChatInputItem {
}
lazy private var internalTabView: TabInputButton = {
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance)
return TabInputButton.makeInputButton(withAppearance: self.buttonAppearance, accessibilityID: "text.chat.input.view")
}()
public var selected = false {