简体   繁体   中英

How to use _whyIsThisViewNotFocusable in tvOS?

To debug the focus issues _whyIsThisViewNotFocusable method is available in the tvOS, But in debug in shouldUpdateFocusInContext with this command like this po [mainView _whyIsThisViewNotFocusable] or po mainView _whyIsThisViewNotFocusable it gives me error :

error: <EXPR>:1:9: error: consecutive statements on a line must be separated by ';'
mainView _whyIsThisViewNotFocusable

So what is the correct use of _whyIsThisViewNotFocusable ?

I seen this question in some stack-overflow answers but because of less reputation i can't comment in that post/answer

Presumably you're using swift so you shouldn't use obj-c in the debugger. Instead use:

po mainView.performSelector(Selector("_whyIsThisViewNotFocusable")) 

Swift 5

(lldb) po yourView.perform(Selector("_whyIsThisViewNotFocusable"))

Also you can Turn on Live Focus Logging

In your Xcode project, select Edit Scheme and add -UIFocusLoggingEnabled YES to the Arguments Passed On Launch section.

Check this readme .

从 iOS 11 开始,您可以使用UIFocusDebugger

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM