Programmatically changing the selected AnnotationToolbar tool on iOS



I have some difficulties with the AnnotationToolbar on iOS.
I managed to add it to my view, make it appear and disappear and to utilise the tools. To problem is, after using the FreeHandCreate tool, the tool manager changes back to the PanTool but the AnnotationToolbar remains selected to the FreeHandCreate icon. In other words, the toolbar icons remain selected after use, although the currently acting tool is the PanTool. The same goes when I click on the X icon to hide the bar.

I checked the delegate method toolShouldGoBackToPan but it works correctly. Mine is just a graphical issue, if you can say so.


The ToolManager delegate includes a toolChanged: selector. When your ToolManager delegate object (likely your main view controller) receives this message, it can call the AnnotationToolbar’s setButtonForTool: selector. This is how this functionality is achieved in the Complete Reader sample project.