google / GTXiLib

Google Toolbox for Accessibility for iOS
Apache License 2.0
225 stars 41 forks source link

Must be part of view hierarchy to use this method, see API docs for more info, GTXiLib contrastRatioOfUILabel check! #16

Open selin194 opened 4 years ago

selin194 commented 4 years ago

Hey all, I have a question.

I used to receive errors of GTXiLib checks, however I start to receive error that says : failed: caught "NSInternalInconsistencyException", "Label <UILabel: 0x7f9f39166ea0; frame = (40 0; 53.6667 50); text = 'Design'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x6000007991d0>> must be part of view hierarchy to use this method, see API docs for more info."

What could be has changed? Thank you so much! @niksawtschuk

selin194 commented 4 years ago

I guess this error is because of slow loading of elements.

niksawtschuk commented 4 years ago

Seems like you are trying to do a contrast check on a label which does not exist in the window, which means making a snapshot (part of the method used to check contrast) will fail.