realm / realm/SwiftLint

Questionable Accessibility Advice

Open
#5,364 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist

A fellow friend of mine passionate about iOS Accessibility shared this issue description with me.

https://github.com/realm/SwiftLint/blob/ff1e966e3ae8ef9876ec5e80c060a46b5faae8f4/Source/SwiftLintBuiltInRules/Rules/Lint/AccessibilityTraitForButtonRule.swift

I love the idea of a Linting library for Accessibility. I actually built one attached to LLVM for Deque back like 10 years ago attached to CLANG for Objective C analysis... The logic I found analyzing UIView ASTSs back then applies to Swift the same. This rule needs some help :).

The description for this issues suggests that every tappable iOS Control should be Button or a Link. This shows a misunderstanding of what these traits do and their relationship to the Rotor. Counterexamples to this rule include:

  • Interactive GridView Items - Like the iOS launcher screen.
  • Switches, checkboxes, etc.
  • Interactive selectable ListViewCells

Note: There are more counter examples than examples.

A rule that would more accurately satisfy the documented intent of this rule would be a rule that made sure controls that were attempting to exhibit single tap behavior did so utilizing gestures that Voice Control and Switch Control recognize as having a default action... being clickable.

Or even a rule that recommended removing the Trait of Button or Link from a control with a changing value... "Switch Button" should never happen.

Let's chat! :) https://www.linkedin.com/in/ciaiguy/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Source/SwiftLintBuiltInRules/Rules/Lint/AccessibilityTraitForButtonRule.swift and compare its documented intent with the listed iOS control counterexamples. Done requires an agreed correction to the rule's accessibility guidance and a maintainer-approved implementation scope; the issue does not name a test or exact replacement behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
accessibility, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.