All Projects → gonzalezreal → Readinglist

gonzalezreal / Readinglist

Licence: other
An example on using the Mantle Modeling Framework with Overcoat AFNetworking extension.

ReadingList

ReadingList is a sample application that shows how to create a Web Service Client and the corresponding model layer using Mantle Modeling Framework and the Overcoat AFNetworking extension. Specifically, ReadingList allows you to search for books in the iBooks Store and save them in a local database. It won't get an Apple Design Award, but it is a fairly complete real life example.

Reading listBook detailBook search

Installation

In order to build and run ReadingList, you must install first project dependencies via CocoaPods. To do so:

$ gem install cocoapods # If necessary
$ cd ReadingList
$ pod install

Once CocoaPods has finished the installation, open the generated ReadingList.xcworkspace using Xcode and run the sample.

The Model

The best place to start understanding this sample is the TGRBook class, which models every property the that the application needs to know about a book. TGRBook also implements MTLJSONSerializing and MTLManagedObjectSerializing to allow JSON and Core Data entity serialization respectively.

The Web Service

ReadingList book search functionality is built around the iTunes Search Web Service. TGRBookCatalog is the OVCClient subclass that implements this functionality with a few lines of code.

Other Goodies

ReadingList uses some techniques and patterns that are worth mentioning:

  • TGRBookSearchController shows how to separate search UI functionality from the View Controller.
  • TGRArrayDataSource and TGRFetchedResultsControllerDataSource are reusable classes that implement UITableView data sources using NSArray and NSFetchedResultsController respectively.
  • TGRFetchedResultsTableViewController is a reusable UITableViewController subclass that processes NSFetchedResultsController content changes the right way (based on code seen here).

Contact

Guillermo Gonzalez
@gonzalezreal

License

ReadingList is available under the MIT license. See LICENSE.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].