Search code examples
iphoneobjective-ciosipadinstapaper

Display inline footnote in iOS


I was wondering what is the best approach for implementing popover links and inline footnote in iOS?


Solution

  • Thanks for liking my stuff.

    Those popovers/overlays are simply separate UIWebViews that are created with the HTML snippets of the footnote content. The iPad one is shown in a UIPopoverController and the iPhone one is shown in a custom view that slides up on top of the content area.

    Getting it to work well, especially for arbitrary content, requires a lot of little details and tricks, most of which you don't need to implement to get the basic idea working.

    Publishing all of these tricks would be far outside the scope of this fairly broad question. My implementation of these features is a few thousand lines of code at least, not self-contained or generic, and involves cooperation between Obj-C, HTML, CSS, and Javascript. But that's because I care a lot about getting those details right. In practice, it doesn't matter nearly as much as I wish it did.