Skip to content

Commit 27e178e

Browse files
committed
Add accessibility for UI testing
1 parent 39d50df commit 27e178e

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

KVNProgress/Classes/KVNProgress.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ - (void)showProgress:(CGFloat)progress
394394
self.style = style;
395395
self.backgroundType = backgroundType;
396396
self.fullScreen = fullScreen;
397+
398+
self.accessibilityValue = @"displayed";
397399

398400
// If HUD is already added to the view we just update the UI
399401
if ([self.class isVisible]) {
@@ -518,6 +520,7 @@ + (void)endDismissWithCompletion:(KVNCompletionBlock)completion
518520
[progressView cancelCircleAnimation];
519521
[progressView removeFromSuperview];
520522

523+
progressView.accessibilityValue = @"hidden";
521524
progressView.style = KVNProgressStyleHidden;
522525

523526
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil);

KVNProgress/Resources/KVNProgressView.xib

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B17" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
66
</dependencies>
77
<objects>
88
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -13,13 +13,15 @@
1313
<subviews>
1414
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gu2-d7-GWy" userLabel="Background Image View">
1515
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
16+
<animations/>
1617
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
1718
</imageView>
1819
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dvZ-0c-TMi" userLabel="Content View" customClass="UIImageView">
1920
<rect key="frame" x="0.0" y="197" width="320" height="175"/>
2021
<subviews>
2122
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loading..." textAlignment="center" lineBreakMode="clip" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="gXU-1y-b5M">
2223
<rect key="frame" x="20" y="144" width="280" height="21"/>
24+
<animations/>
2325
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
2426
<constraints>
2527
<constraint firstAttribute="height" constant="21" id="V0y-U4-QII"/>
@@ -30,13 +32,15 @@
3032
</label>
3133
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iI6-MR-KeW" userLabel="Loading View">
3234
<rect key="frame" x="103" y="10" width="114" height="114"/>
35+
<animations/>
3336
<color key="backgroundColor" white="0.66666666666666663" alpha="0.5" colorSpace="calibratedWhite"/>
3437
<constraints>
3538
<constraint firstAttribute="width" constant="114" id="c6q-Xh-pet"/>
3639
<constraint firstAttribute="height" constant="114" id="mRF-1b-hE3"/>
3740
</constraints>
3841
</view>
3942
</subviews>
43+
<animations/>
4044
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
4145
<constraints>
4246
<constraint firstItem="gXU-1y-b5M" firstAttribute="top" secondItem="iI6-MR-KeW" secondAttribute="bottom" constant="20" id="EMi-mI-8Vy"/>
@@ -49,8 +53,12 @@
4953
</constraints>
5054
</view>
5155
</subviews>
56+
<animations/>
5257
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
5358
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
59+
<accessibility key="accessibilityConfiguration" identifier="loader">
60+
<bool key="isElement" value="YES"/>
61+
</accessibility>
5462
<constraints>
5563
<constraint firstAttribute="bottom" secondItem="gu2-d7-GWy" secondAttribute="bottom" id="Be3-ek-XOn"/>
5664
<constraint firstAttribute="centerY" secondItem="dvZ-0c-TMi" secondAttribute="centerY" id="F1z-jy-68E"/>
@@ -76,9 +84,4 @@
7684
</connections>
7785
</view>
7886
</objects>
79-
<simulatedMetricsContainer key="defaultSimulatedMetrics">
80-
<simulatedStatusBarMetrics key="statusBar"/>
81-
<simulatedOrientationMetrics key="orientation"/>
82-
<simulatedScreenMetrics key="destination" type="retina4"/>
83-
</simulatedMetricsContainer>
8487
</document>

0 commit comments

Comments
 (0)