Reputation: 35935
I am trying to find out how a UIView
s transformation matrix is being modified. Thus (using the gdb
console) I'd like to watch for any/all changes of the UIView
's transform
property. How would I go about doing so?
Upvotes: 21
Views: 6041
Reputation: 257
If you're like me, and don't write in Obj-C, here's a quick Swift way to do it for beginners.
Just add a didSet
to the property, and a breakpoint inside the block.
Upvotes: 0
Reputation: 10346
Use a symbolic breakpoint -[UIView setTransform:]
. Note that you can also use a condition with $arg1 (works only on 64bit simulator like iphone 5s) compared to some pointer to catch breakpoints on property change only for a specific instance $arg1 == 0x7f9cbba75e60
. Screenshot below shows a breakpoint that catches changes on transform property only for UIView instance that has a pointer 0x7f9cbba75e60
Upvotes: 13
Reputation: 36752
Add a symbolic breakpoint in Xcode. Use -[UIView setTransform:]
as the Symbol.
Use a more narrow subclass class if you want less or more specific output.
Upvotes: 30