This was a curly one! I also fixed a bunch of Xcode 8 warnings (for
non-third-party code; I'd like to fix the third-party ones to get to
zero warnings, but don't know how you feel about that).
Funnel all HTML loading through -loadHTMLString:.
Cache base URL (which is always the same) in a static variable instead of computing it different ways and putting in an instance variable temporarily.
Use more intention-revealing variable names.
Only set hasStory when we’re actually loading the story itself.
Only set the font size and line spacing once, in webViewDidStartLoad, because the DOM is always set up by then in my experience.
Only bother to set font size and line spacing if we’re loading a (full) story.
Show the Web view when a full story *starts* to load, as sometimes it may not complete but you still want to see a partially loaded story. (Fixes an intermittent issue with AnandTech; see https://getsatisfaction.com/newsblur/topics/anandtech-straight-up-doesnt-load-on-the-ios-app)
Don’t try to subclass UIActivityItemProvider as well as implement UIActivityItemSource - the latter is better suited for what NewsBlur wants to do (provide different items based on activity type).
Provide the URL as a separate item where possible; only return strings from UIActivityItemSource.
Crashed due to the -addKeyCommand: method not being available before
iOS 9. @nriley may want to implement some alternative solution (e.g.
overriding the -keyCommands method), but this fixes the crash.
Use the same popover creation code in more places, which adds Escape and
Command-. to dismiss popovers.
Ensure that popovers both get and can accept first responder, preventing
keyboard input from leaking through to an underlying view controller.
Without this, it can be confusing as, for example, you can navigate to a
different story while you’ve got a ‘mark read’ popover shown for another
story.
Lets the menu table views do their own height calculations and makes the bottom vertical inset match the top (negative) to avoid extra white space at the bottom of the popover.
The preferredContentSize of FontSettingsViewController was previously hard-coded to account for a navigation bar which was subsequently hidden, which could sometimes result in a too-small popover if the navigation bar was already hidden; hide it explicitly instead and remove this workaround.