iOS change accessibility focus.

前端 未结 3 1308
挽巷
挽巷 2021-01-03 17:40

is there a way to set the accessibility focus programatically (App Store-safe)? Any help will be greatly appreciated.

3条回答
  •  误落风尘
    2021-01-03 18:34

    This is the Swift code:

    UIAccessibility.post(notification: .screenChanged, argument: )
    

    Example usage

    let titleLabel = UILabel()
    
    override func viewDidAppear(_ animated: Bool) {
            super.viewDidAppear(animated)
            UIAccessibility.post(notification: .screenChanged, argument: titleLabel)
    }
    

提交回复
热议问题