I have been looking for an example showing how to implement a custom UIDynamicBehavior in UIKit dynamics. All the tutorials and examples show only how to assemble a UIDynamicBehavior using primitives (collision, gravity, attachment, push, snap etc.)
In my app, some views are floating around the screen (using dynamics) and I want to make them disappear when they overlap other stationary views. To do this, I wanted to test for overlap in the UIDynamicAnimator and UICollisionBehavior delegate methods, but unfortunately those methods do not provide enough granularity to get perform the tests I need.
EDIT: apparently I had to wait a day before answering my own question (new user), so my solution is posted below as an answer now.
The approach I chose was to develop my own UIDynamicBehavior class and add that to the animator, and it now makes the floating views disappear when they overlap the stationary views.
Sample code below shows how to write your own UIDynamicBehavior class to plug your own behaviour into the UIDynamicAnimator. I called the class UISinkBehavior, because it "sinks" a view when the view moves over the "sinkhole".