File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 139139 3B21D4862785F3EF0009DE6A /* PBXTargetDependency */,
140140 );
141141 name = LCLabelUITests;
142+ packageProductDependencies = (
143+ );
142144 productName = LCLabelUITests;
143145 productReference = 3B21D47F2785F3EF0009DE6A /* LCLabelUITests.xctest */;
144146 productType = "com.apple.product-type.bundle.ui-testing";
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ final class LCLabelHitTests: XCTestCase {
1818 app = XCUIApplication ( )
1919 app. launchArguments = [ " " ]
2020 app. launch ( )
21+
22+ XCTAssertEqual (
23+ app. staticTexts. matching ( . staticText, identifier: " lcllabel+1 " ) . firstMatch. identifier,
24+ " lcllabel+1 " )
25+
2126 let main = app. otherElements [ " main " ]
2227 XCTAssertTrue ( main. exists)
2328 XCTAssertTrue ( main. staticTexts [ " translator " ] . exists)
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ final public class LCLabel: UIView {
5050 }
5151
5252 // MARK: - Variables
53+
54+ public override var accessibilityTraits : UIAccessibilityTraits {
55+ get {
56+ _accessibilityTraits
57+ }
58+ set {
59+ _accessibilityTraits = newValue
60+ }
61+ }
62+
5363 /// A LCLabel delegate that responses to link interactions within
5464 /// the view
5565 public weak var delegate : LCLabelDelegate ?
@@ -126,6 +136,7 @@ final public class LCLabel: UIView {
126136 renderedStorage = nil
127137 isHidden = true
128138 }
139+ accessibilityIdentifier = newValue? . string
129140 setupRenderStorage ( )
130141 refreshView ( )
131142 }
@@ -143,14 +154,16 @@ final public class LCLabel: UIView {
143154 } ( )
144155
145156 private var currentlySelectedLink : URL ?
157+ private var _accessibilityTraits : UIAccessibilityTraits
146158
147159 // MARK: - Life Cycle
148160
149- public init ( ) {
150- super . init ( frame: . zero)
161+ public convenience init ( ) {
162+ self . init ( frame: . zero)
151163 }
152164
153165 public override init ( frame: CGRect ) {
166+ _accessibilityTraits = . staticText
154167 super. init ( frame: frame)
155168 }
156169
You can’t perform that action at this time.
0 commit comments