Używanie iOS Inspektor dostępności do poprawy użyteczności aplikacji
Wprowadzenie
Treatyng accessible iOS apps is none billion just a best practe - it 's a fundamentaltal requirement for reaching thee wide possible audience. More than one billion one worldwide live with some form disability, and man of them rele assistivy technologies like VoiceOver, Switchh control, and Dynamic Type te interact with mobile applications. Thee OS Accessibility Inspector, built directly intro Xcore, gives developers a systematic way tauid their for issibility eds eds eds ear ear ear in thee develoment procules.
Co to jest? Inspektor ds. akceptacji?
Te iOS Accessibility Inspector is a testing tool that ships wigh Xcode, accepte 's integrated development environment. It providees a real-time, graphical interface for examinang thee accessibility properties of every UI element in your app. Unlike automate d linting tools that check code for missing labels, thee Accessibility Inspector lets you interact with your live app on a device or simulator while inspectivine how assive technologies like Voicever perceivee elent.
Inspektorzy krytykują takie atrybuty jak: accessibility label, trait, hint, value, and frame. It also indicates whether ar element is focused by VoiceOver, whether accessibility acsibility elements, and whether is accessility configured for Switchl vigation. Additionally, thee tool includes an exan 1r; FLT: 0 contribuild 3; Audit exi1or 1; FLT: 1; FLT: 1; 1 3XD; Xiure 3e thatt scandigions your four for; n quien accessibility, such ations, such indift indirect, missine, missing lasts, ung lates, unges ungees.
Amplitule continually updates the inspector to support new iOS accessibility factories, including ding Dynamic Type, reduced motion, and bold text preferences. By integrating thee inspector into your regular workflow, you ensure your app ensure compatible with thee lateste assistivy technologies andd adheres to evolving accessibility standards like thee Web Content Accessibility Guidelines (WCAG) 2.1.
How tu Set Up and Launch thee Accessibility Inspector
Getting started with the Accessibility Inspector requires a macOS machine with Xcode installad. Follow these steps to launch th tool and d prepare for testing:
- Xion1; FLT: 0 is 3; Xion3; Open your project is 1; Xion1; FLT: 1 is 3; Xcode andbuild it to a connectod iOS device or a simulator. The inspector works best on a siciel device, but the simulator provides a close approximation.
- Navigate tu Simp1; GT; FLT: 0 Simp3; Xcode Simpl; gt; Open Developer Tool Toomp; gt; Accessibility Inspector Simpl1; GLT: 1 Simpl3; GL1; FLT: 1 Simpl3; GL3. Alternatively, you can use the shortcut Simp1; GLT: 2 Simpl3; GLT: 3; Cmd + F6 Simp1; GL1; FLT: 3 Simpl3; if you have it assigned.
- Nie ma możliwości, aby inspektor mógł się z nim skontaktować.
- Once connected, you 'll see the inspector' s main interface: a live snapshot (or live view) of your app 's screen on thee left, and a detaid a specified perfective inspector on thee right.
Te inspector runs a standalone application, which means you can keep it open alongside Xcode and your app. As you vigate through different screens, the inspector updates in real time, showing the e accessibility hierarchy of thee concurt view. You can click any element in thee live view to display its accessibility contrities.
Simulating Accessibility Settings
A cucial aspect of thee inspector is ability to simulate various accessibility settings that users may enable on their devices. Click the ability 1; Increase 1; FLT: 0 equil 3; Settings assibility 1; FLT: 1 ethil 3; 3; icon thee toolbar to toggle on voiceOver, Increase Contratt, Reduct Motion, On / Off Labels, Button Shapes, and more. Thiaveites enables you tsee see eaid how your app adampts - or fairs - tt - tt setting. For example, enabling Voeites Oveit thel tol vial thel tol visl visill hn hl ht ephexed ef.
Core Features of the Accessibility Inspector
Inspektor i jego mory to kompetentny widz.
1. Inspektor Element
Te element inspektor displays all accessibility properties for thee currently selected UI element. Key fields include:
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Label Xiv1; Xiv1; FLT: 1 Xiv3; Xiv3;: A short, descritiva string read by VoiceOver. Should match the visible label wheren possible.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Value Xi1; Xi1; FLT: 1 Xi3; Xi3;: The curitt state of a control (np., quiquit; 50% Xiquiquite; for a volume slider).
- Xi1; Xi1; FLT: 0 XI3; XI3; XI3; XI1; FLT: 1 XI3; XI3;: XIBES TE Element 's behavor (np., XICON; Button, XICOT; XICOT Quentin; Headder, XICOT; XICOL Quent; XICOL; XICOL; XICOL; XICOVER).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Hint Xi1; Xi1; FLT: 1 Xi3; Xi3;: Additional instructions (np., quitude quittions; Double-tap to open the menu Xionquitle;). Usie hints sparingly; rely on clear labels and traits firss.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Frame Xi1; Xi1; FLT: 1 Xi3; Xi3;: The bounding prostokąty of te te element, which helps you verify touch precis are large enough (at leaast 44 × 44 points).
- BENEFICJENCI: 1; BENEFICJENCI: 0; BENEFICJENCI: 0; BENEFICJENCI: 1; BENEFICJENCI: 1; BENEFICJENCI: 0; BENEFICJENCI: 0; BENEFICJENCI: 3; BENEFICJENCI: 1; BENEFICJENCI: 1 BENEFICJENCI; BE ASISISISISION Technologies; BENEFICJENCI:
Te inspektor also highlights is 1; Xi1; FLT: 0 is 3; Xi3; misconfigured elements presents 1; Xi1; FLT: 1 message 3; Xi3; with red badges. For example, an image without out an accessible label will show content quote; Missing Label. acquit; Clicking thee badge often provides a supgention for fixing thee ise.
2. Samochód
Audior Figurure wykonuje statyczne analizy, które mają wpływ na swiecenie i listy, ale także na wykrywanie naruszeń związanych z akcesyfikacją.
- Missing or non-descriptive labels on images and buttons.
- Niezbędna kolor kontrast between text and background.
- Elements that are too small to tap comfort.
- Niepopierane przyjazdy.
- Elements that are incorrectly marked as accessibility elements or are hidden frem assistive technologies.
Each issue includes a searity level (Info, Warning, or Error) and a link to thee relevant element. By running an audit after every major UI change, you catch regressions quickly.
3. Ustawienie Simulationa
Te Settings panel lets you toggle:
- Xi1; Xi1; FLT: 0 Xi3; Xi3; VoiceOver Xi1; Xi1; FLT: 1 Xi3; Xi3; - symulates screen-reater vigation.
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Switchh Contral Xiv1; Xiv1; FLT: 1 Xiv3; Xiv3; - hivlighs scan order and selection areas.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Vyricase Contract Xi1; Xi1; FLT: 1 Xi3; Xi3; - tests legibility with reduced transparency.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Reduce Motion Xi1; Xi1; FLT: 1 Xi3; Xi3; - disables parallax andd animations.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; On / Off Labels Xi1; Xi1; FLT: 1 Xi3; Xi3; - ensures switch controls display text alongside color.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Button Shapes Xi1; Xi1; FLT: 1 Xi3; Xi3; - underlines text buttons to make them more visible.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Bold Text Xi1; Xi1; FLT: 1 Xi3; Xi3; - tests layout rogartness with heavier fonts.
Practical Walktripg: Testing a Sample Screen
Let 's assume you have a logn screen with a username text field, a password text field, a quentice quentity; Sign In contribution quentity; button, and a quentiquentive; Forgot Password? contribution; link. Here' s how to use thee inspector to verify accessibility:
- Launch thee app in thee simulator and open thee login screen.
- Open thee Accessibility Inspector andsect your simulator.
- Click thee username text field in thee live view. The inspector should display it label as quenquente; Username. Quencile; If thee label is missing or says something else (e.g., contriquent; Text Field quentived quent;), you need tte thee exent 1; FLT: 0 contribul 3; contribuilder or in code.
- Check thee trait for each field. For a text field, thee trait should be be indi.1; Gior1; FLT: 0 contribul 3; Gior3; Search Field individu1; Gior1; FLT: 1 contribution 3; Giordinate 3; or simple left as default. For the Sign In button, thee trait mutt be endisation 1; Gior1; FLT: 2 contributiona3; Button endividu1; Giordinate 1; FLT: 3 contributional3;
- Select thee messagequent; Forgot Password? messagecult; link. Ensure it label is messagequent; Forgot Password? messagequent; and it s trait is indic1; enticed 3; FLT: 0 message; Link messaged; enticed; FLT: 1 messagel; FLT: 1 message3; If it 's a button styled as a link, thee trait should mein mein edirecoder; FLT: 2 messaged; Butoton message; Buttol megat 1; FLT: 3 megage 3d; And thee label labeid make actioun clear (e.
- Run the Audit by clicking the indic1; Xi1; FLT: 0 XI3; XI3; Audit XI1; XI1; FLT: 1 XI3; XI3; button (a checkmark icon). The inspector will scan thee scrien and report any issues. Common findings included de missing labels on icons or indicuent contrast for placeholder text.
- Fix the issues in your code, rebuild, and re-audit until the screen passes with zero errors.
- Finally, enable VoiceOver in thee inspector 's settings and Navigate the screen using the keyboard (Tab to focus, Space to activate). Verify that VoiceOver reads the fields in a logical order andthat the hints, if any, are helpful.
Common Accessibility Emites and How to Fix Them
Trough consident use of thee Accessibility Inspector, you 'll meetter recurring Patterns. Below are some of thee most contrin issues and their ir recommences.
Missing or Misleading Labels
Images, buttons, and conserm controls of ten cak a descritivy label. Always set presen1; Images 1; Images 1; FLT: 1 contribution 3; Images. For decorative images, mark them as presentive 1; Image 1; FLT: 2 contribution 3; Image 3; or uncheck presenquit; Accessibility Enabled elements; in Interface Builder. For non-decorative images, thee labele expresence thee decie, not juste thee file name.
Nieprawidłowe traits
Support: 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 127t; 1t; 127t; 127t; 1t; 1t; 1t; 127t; 1t; 1igt; fln; 1igt; 2n; 1t; 1t; 1t; 1supr; 1t; 1supn; 1t; 1t; 1b; 1t; 1suplt; 1t; 1t; 1b; 1b
Kontrakt Poor Color
Te inspector 's Audit can declart insument contrast between text and background. However, it relies on ther contrast ratio calculation defined in WCAG 2.1. For text smaller than 18 points, thee minimum contrast ratio is 4.5: 1; for larger text, 3: 1 is acceptable. Usie thee inspector' s contrast warning as a guide, then adjust your colors accordilingly. Avoid relying solele on color to comvesty information; always inclue ole our texed.
VoiceOver Navigation Order
Te inspektor 's element hierarchy pokazuje, że VoiceOver porusza się w sposób niepoprawny, adjuszt ten jest następcą tego wizuala layouta (left-to-right, top-to-bottom). If thee order is incorrect, adjuss the employ1; FLT: 6 contribute 3; YOU can also set; array or modify thee element' s environment 1; FLT: 7 contribuild 3e; tà guidee VoiceOver. You can also set 1contribuilt: 8 contribuilt 3d; On content.
Integrating Accessibility Testing into Your Workflow
Using the Accessibility Inspector manually is effective, but to do accessibility consident quality, you should d integrate accessibility checks into your development engline.
Human Testing
Podczas gdy automat narzędzi Catch many issues, they can not t replicate thee nuanced experience of a real user. Schedule periodic sessions where team members with or with out disabilities tect thee app using VoiceOver, Switchh Contral, and tell assistitiva technologies. Thee Accessibility Inspector helps you precile for these sessions by surfacing obvious problems first.
Automated Testing wigh XCTEST and XCUItest
Te Accessibility Inspector 's Audit Facilure can be invoked programmatically in your UI tests. Accessibility provides the e e.1.; FLT: 9 e.3; E.3; (in private API), but you can also use XCUITett to query accessibility elements andd assert their contributies. For example:
let button = app.buttons["Sign In"]
XCTAssertTrue(button.exists)
XCTAssertEqual(button.label, "Sign In")
This ensures that the accessibility label is set correctly across builds. Combinate these assertions with visail regression tests to maintain high standards.
CI / CD Integration
You can run the Accessibility Inspector 's Audit as part of a command-line tool by using thee besi1; Simen1; FLT: 11 X3; Simen3; subcommand in behavior 1; Simen1; FLT: 12 XCode 3; Simen3; (acceptable in XCode 14 +). Add a step in your Continuos Integration script that fairs the build if audit errors end a bailold. For example:
xcodebuild -project MyApp.xcodeproj -scheme MyApp -destination 'name=iPhone 14' test-without-building accessibility:audit
This keeps accessibility quality gated before merging pull requests.
Beyond thee Inspector: Komplementary Tools
Te Accessibility Inspector is your primary tool, but it works best alongside other:
- Xi1; Xi1; FLT: 0 Xi3; Xi3; VoiceOver gesture simulator Xi1; Xi1; FLT: 1 Xi3; Xi3; - practice two-finger rotations andthree-finger taps.
- Xi1; Xi1; FLT: 0 Xi3; Xcode Accessibility Verifier Varifier 1; Xi1; FLT: 1 Xi3; Xi3; (deprecated) - replaced by the inspector 's Audit.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Colour Contract Analyser Xi1; Xi1; FLT: 1 Xi3; Xi3; - a standalone macOS app to check trójst ratios more precisely.
- Xif1; Xif1; FLT: 0 Xif3; Xif3; Dynamic Type preview Xif1; Xif1; FLT: 1 Xif3; Xcod 's Environment Overrides to tect all text sizes.
Assessment 's presentation 1; Amend1; FLT: 0 is 3; Acepsibility documentation presentation 1; Amend1; FLT: 1 is 3; Amend3; provides extensive guides andd sample code. Additionally, thee event 1; Amend1; FLT: 2 memoriality 3; Applies to mobile appens apendix 1; APP1; FLT: 3 metribuil3; Offer a conclussive framework for digital accessibility that appplies to mobile appens apens apens well.
Korzyści z Making Accessibility a Priority
Investing in accessibility yields direct returns for both users andyour continues:
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Expanded user base XiV1; XiV1; FLT: 1 Xiv3; XiV3;: About 15% of the global population experiiences some form of disability. Missing accessibility acquality acqualitures effectively locks out a Xivativant audience.
- Xiv1; Xiv1; FLT: 0 X3; Xiv3; Improved usability for everone Xiv1; Xiv1; FLT: 1 XI1; FLT: 0 XIX3; FLT: 0 XIX3; XIX3; XIX3; Improved usability for everone; Xivy1; FLT: 1 XIX3; XIX3; XIX3; XIX3;: Features like clear labels, large tap pretarges, and good contrast benefit all users, especially in contexing context like bright sunlight or on e-handed use.
- Refere 1; Simpli1; FLT: 0 Simpli3; Simpli3; Legal compleance Simpli1; Simpli1; FLT: 1 Simpli3; Simpli3;: Many countries have enacted laws requiring digital accessibility (np., the Americans with Disabilities Act, the European Accessibility Acct). Proactive testing reduces litigation risk.
- Recenzje: 1; 1; 1; FLT: 0; 0; 0; 3; Better App Story reviews: 1; 1; 3; FLT: 1; 3;: Users who rely one assistiva technologies are vocal about apps that work - or don 't. Pozytiva reviews from the e accessibility community can boost your app' s rating.
- Reconduction: 1; Department efficiency (FLT): 0; 0; Development efficiency (EFI); Development Efficiency (EFI): 1; FLT: 1; FLT: 1; FLT: 0; FLT: 0; FLT: 0; FLT: 3; FLT: 0; FLT: 3; FLT: 0; FLT: 0; FLT: 0; FLT: 3; FLT: 0; FLT: 3; FLT: 1; FLT: 1; FL1; FLT: 1; FLT: 1; FLT: 1; FLS: 0; FLS: 0; FLS: 0; FLS: 0; FLS: 0: 0: 0: 0: 0: 0: 0: 0% FLS: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0%%%%%%%%%%
Konkluzja
Te iOS Accessibility Inspector is a powerful yet underutized tool that asy every iOS developer into their daily workflow. Bye using thee element inspector, running regular audits, and simulating assistive technology settings, you can identify and then identify ande resolve contragers thatt prevent millions of users from fuly ensisteng inging wich your app. Accessibility is nott a checkliste tt to complete before elepe - it aid ongoing commitment o inclusionn d.