Adding UIPreviewActionItem
to SFSafariViewController
might be a tedious task. This extansion should help.
let vc = SFSafariViewController(initialURL: url, entersReaderIfAvailable: true)
vc.previewActionItemsDelegate = self
When presenting SFSafariViewController
use convenience initializer that will store original URL for later, it'll make custom action requiring original URL easier. But it's not mandatory.
Here is the delegate implementation, this is where we might want to use initialURL
func safariViewControllerPreviewActionItems(controller: SFSafariViewController) -> [UIPreviewActionItem] {