TabInputButton accessibilityId introduced (#206)
* TabInputButton accessibilityId introduced * TabInputButton accessibilityId introduced
This commit is contained in:
parent
22a3833761
commit
b98c487643
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue