The way tool library callbacks work has changed for better transparency and customization. Updating existing code to work with the new PDFViewCtrl should only take a couple of minutes and is described here.
Previously, PDFViewCtrl had a tool property that would be sent events and would be destroyed and replaced by new tools by the control when required. The new system moves the tools destruction/creation logic outside of the control so that it can be accessed and modified by users of the SDK. In 6.2.0, instead of directly setting a tool on the PDFViewCtrl, a “ToolManager” is registered to receive events, and it is the ToolManager’s job to then pass these events to the actual tools as well as destroy and create new tools when necessary.
So before the first tool would have been registered as so:
// assign the initial tool as a PanTool [myPDFViewCtrl setTool:[[PanTool alloc] initWithPDFViewCtrl:myPDFViewCtrl];
This is now done as so:
// create a tool manager _toolManager = [[ToolManager alloc] initWithPDFViewCtrl:myPDFViewCtrl]; // set the initial tool to be a pan tool [_toolManager changeTool:[PanTool class]]; // set the tool manager to receive the events from the PDFViewCtrl myPDFViewCtrl.toolDelegate = _toolManager;
Subsequent changes to the active tool can be made within the app like this:
[_toolManager changeTool:[ADifferentTool class]];
[_toolManager setTool:[[ADifferentTool alloc] initWithPDFViewCtrl:myPDFViewCtrl]];
The source code for the new (default) ToolManager can be found in the Tools project, located at Lib/src/PDFViewCtrlTools/Tools/ToolManager.m.