Apple introduced Reading List feature in iOS 5 and Safari 5, but there was no way to access it programmatically. Two years later, with iOS 7, Apple added API to add URLs to user’s reading list and they’re included in newly introduced Safari Services framework.
With unknown reason, Safari Services framework has not been providing any documents about that. Apple just says that see the framework header files1. As you can check it out
SafariServices/SSReadingList.h, it has a very simple set of API methods. Here’s usage:
#import <SafariServices/SSReadingList.h> NSURL *url = [NSURL URLWithString:@"https://www.euler.kr/trl/2014/07/19/adding-urls-to-reading-list/"]; SSReadingList *list = [SSReadingList defaultReadingList]; [list addReadingListItemWithURL:url title:nil previewText:nil error:nil];
#import SafariServices let url = NSURL(string: "https://www.euler.kr/trl/2014/07/19/adding-urls-to-reading-list/") let list = SSReadingList.defaultReadingList() list.addReadingListItemWithURL(url, title: nil, previewText: nil, error: nil)
previewText is set to
nil, then it will be automatically loaded from the URL in a minute or when the item is opened on Safari.
addReadingListItemWithURL... method returns
NO if the item was not added. It maybe the item has a scheme that Reading List doesn’t support. Only URLs with
https:// schemes are supported.
Sadly there is a small minority of apps that supports Add to Reading List. I wish this feature would be added into as many as apps possible, such as Facebook, Google+.
- iOS Technology Overview: Core Services Layer (iOS Developer Library)