Hidden Goodies in OvershareKit
Together with Justin Williams, I recently announced an open-source iOS sharing library called OvershareKit (available on GitHub). It makes it trivial to add rich sharing options to your iOS apps. There’s enough material in OvershareKit to warrant many blog posts, but I figure I should start with some of the cooler bits that you might not discover right away:
OSKTextView: A Better UITextView
OvershareKit comes with OSKTextView, a fork of JTSTextView, my open source UITextView wrapper (until Apple fixes some bad iOS 7 bugs with UITextView). The OvershareKit version has some nifty additions. It can highlight links, hashtags, and @mentions as you type. You can move the cursor with the Riposte-style swipe gestures: one finger to move by character, two fingers by words, and three fingers by paragraphs. It also automatically converts dumb quotes to smart quotes.
Built-In Support for In-App Purchases
This was Justin’s killer idea. Your app may have certain sharing activities that require in-app purchases (e.g. Riposte only shows the OmniFocus and Things options if you’ve upgraded to Riposte Pro). Why hide those from the share sheets, when OvershareKit could do more? Once you mark your chosen activity types as requiring in-app purchase, OvershareKit will badge those activity icons with little price tag indicators until they’re purchased. If a user taps one of them, OvershareKit queries the relevant OSKPresentationManager delegate for your custom purchasing view controller. You are still responsible for making the purchase from the App Store, and for storing/validating purchase receipts.
Optional Dark Mode
More and more customers are realizing how nice it is when an app shifts to a low-light mode or “dark mode” during evening hours. OvershareKit has an optional dark mode setting, which you can trigger through the OSKPresentationManager’s style delegate. You can also customize many of the default colors.
1Password Buttons
The username / password screens in OvershareKit show 1Password search buttons if that app is installed. Tapping the button launches 1Password with a search query based on the activity, e.g. “Instapaper.” This logic is based on some open source code I wrote for Riposte, available on GitHub.
Account Management
With the exception of Pocket, all third-party services in OvershareKit support multiple accounts. We included an account management screen that you can use to add or remove accounts for each service. You can see the accounts screen in the sample app by tapping the left navigation bar button from the app’s main screen. You’ll know best where this screen should live in your application.
VoiceOver and Localization
OvershareKit’s views and alerts have 100-percent VoiceOver coverage. All user-facing strings are in English, but you can provide localizations via the localizationDelegate of OSKPresentationManager. Never ship an app without VoiceOver, and never ship a new design without testing its accessibility implications first. Ask your users for help. You probably already have some tech-savvy users with visual or other impairments that would love to join your beta team. Look for smart folks like Marco Zehe and Steven Aquino.