psharanda / Atributika

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
MIT License
1.45k stars 155 forks source link

Accessibility Issue : Here UIAccessibilityTraits.button. should be UIAccessibilityTraits.Link #171

Closed akshayjain14 closed 9 months ago

akshayjain14 commented 10 months ago

private func addDetectionAreaButton(frame: CGRect, detection: Detection, text: String) { let button = DetectionAreaButton(detection: detection) button.accessibilityLabel = text button.isAccessibilityElement = true

if swift(>=4.2)

    button.accessibilityTraits = UIAccessibilityTraits.button
    #else
    button.accessibilityTraits = UIAccessibilityTraitButton
    #endif

    button.isUserInteractionEnabled = state.isEnabled
    button.addTarget(self, action: #selector(handleDetectionAreaButtonClick), for: .touchUpInside)
    detectionAreaButtons.append(button)

    button.onHighlightChanged = { [weak self] in
        self?.state.detection = $0.isHighlighted ? $0.detection : nil
    }
psharanda commented 10 months ago

@akshayjain14 see my comment in https://github.com/psharanda/Atributika/pull/172