A demo project that goes alongside a presentation on Promises.
The demo takes an App.net username, loads that users followers and following, and shows the differences between those two sets of users with avatars for each user that it displays.
You need to do a couple things to build and run the app:
- Initialized the git submodules:
git submodule update -i --recursive
. - Add an environment variable, ADNACCESSTOKEN, with a ADN access token. You can set this in the Run section of the Promises scheme.
The project has several different implementations of the code that loads data from ADN:
- A synchronous version that blocks the main thread
- An asynchronous version written with GCD
- An asynchronous version written with Promises
- An asynchronous version written with a client that returns Promises
- An asynchronous version written with a ReactiveCocoa client
To switch implementations, change which version is commented out in
[PRMAppDelegate loadUser:]
.