As long as you can distill your object into one of the supported types, you can provide a visualization for your own objects.
No matter that the class is
PhoneNumber, to demonstrate the feature I just implemented the
method by returning a
UIView is also supported, however it seems to be limited to
You might notice that if you just have a variable of a
UIView that you
can’t take advantage of this. Instead, you’ll get this message:
My suspicion is that this is because the
- debugQuickLookObject method is implemented
on a category method that is included by
UIViewController. I’m not entirely sure
if this is the case, but we can create our own category method to provide the same behavior.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Once that’s done, I just include the category method header in my view controller, and quick look debugging of view variables now works: