/RealmTwitterExample

Delayed posts and updates to Twitter timeline, using Realm as storage

Primary LanguageSwiftMIT LicenseMIT

RealmTwitterExample

This example code demonstrates posts and feed refreshing happening simultaneously, using Realm as the persistence layer. Used as a live demo of how the basics work in context of async networking, and delayed spooler-type uploads, with reads and writes in different threads to update the display of Tweets in a UITableViewController.

Because this is sample code, posts and refreshing happens via naive polling in the app's main view controller. However, data updates happen by responding to Realm notifications, and then updating the UI in the main thread (Realm notifications in the view controller are set-up here to happen the main run loop by default.)

Setup

After cloning, make sure submodules are updated. If you're uncomfortable with submodules, running scripts/setup.sh should help you get going.

Test Account Recommended

This example will post timestamp Tweets to whatever Twitter account you choose via iOS Settings. Unless you want these weird-looking timestamp tweets in your personal Twitter timeline, you should setup a test account for this information.

Reminder: The Twitter API is rate-limited, so be wary when you update the default time interval, which are set to conservative defaults.

XCode 8 & Swift 3 Required

I wrote this code a month before the release of XCode 8. The Beta-1 migration tool was good enough to successfully migrate this app's code.

As of this writing, there's a spew of messages in the console with keywords like nw_connection_endpoint_report. Dumb-guessing, but it seems to be coming from networking dependencies in the Realm framework. Will be filing an issue if it's not already there.