I have a custom annotation which draws an external window. The DrawEx callback of the subclassed AVAnnotHandler handles the drawing and positioning of the window so that it appears at a static position. Thus, when the page scrolls, the window scrolls with it. The issue here comes when the window scrolls off the screen. I need some callback I can use to then go and hide the window.
In DrawEx: I move my window to AVPageViewGetAnnotRect() - AVPageViewGetAperture(). This works fine for displaying. If, however, I have an annotation on page 1, and scroll to page 2, the draw procedure is no longer called. I also tried using the PerformOp and CanPerformOp callbacks. However, I found that kAVAnnotDoPageIsNotInView does not fire in certain view modes. Is there a better way to go about this? Any pointers would be appreciated.