readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
225 stars 96 forks source link

Added shouldNavigateToLink on NavigatorDelegate #331

Closed chrfalch closed 10 months ago

chrfalch commented 10 months ago

To be able to implement alternative ways of internal links, like presenting it in a separate view, this commit adds a NavigatorDelegate method called shouldNavigateToLink that by default returns true - but can be overridden to signal to the caller that we've handled the resource outside of the regular flow.

This can be used to catch things like links to non-linear resources (Impossible to open resource with linear=no #330).