
private func setupAccessibility() {
cancelButton.accessibilityLabel = "주문 취소하기"
paymentButton.accessibilityLabel = "결제 진행하기"
totalQuantityLabel.accessibilityLabel = "총 주문 수량"
totalAmountLabel.accessibilityLabel = "총 결제 금액"
}
<!-- 버튼에 aria-label 추가 -->
<button aria-label="주문 취소하기">취소</button>
<button aria-label="결제 진행하기">결제</button>
<!-- 이미지에 대체 텍스트 추가 -->
<img src="product.jpg" alt="빨간색 티셔츠">
<!-- 역할 정의 -->
<div role="alert">결제가 완료되었습니다!</div>
<!-- 숨겨진 설명 추가 -->
<span class="visually-hidden">총 주문 수량:</span>
<span>3개</span>
accessibilityLabel 프로퍼티 사용aria-label, alt, role 등 다양한 속성 사용두 플랫폼 모두 접근성이 매우 중요하며, 각자의 방식으로 구현하지만 목적은 동일합니다. 모든 사용자가 콘텐츠에 접근할 수 있도록 하는 것이 핵심입니다! 💝
#iOS #HTML #Accessibility #WebDevelopment #SwiftUI #ARIA 🏷️