I have QLPreviewView
and I need to check if the preview is loaded in n
seconds after assigning QLPreviewItem
. QLPreviewView
and QLPreviewItem
don't have any events for loading and any fields to check it, so I came with checking view hierarchy. It works pretty good with my few test cases, but ofc hierarchy can be changed in new versions of mac OS. Another solution could be working with field displayState
. It's always nil when preview isn't loaded, but it can be nil when preview is loaded (for example for folder preview which doesn't have state). So even if we have displayState
equal to nil, we still need to check if file can own any preview state at all, i.e. this solution depends on concrete mac OS version too.
Is there any tricks which are better then observing view hierarchy? Or may be is there any alternatives to QLPreviews?