Book Image

RestKit for iOS

By : Taras Kalapun
Book Image

RestKit for iOS

By: Taras Kalapun

Overview of this book

<p>RestKit is an iOS framework for streamlining communication with web services, and it relies on the AFNetworking library that is used by thousands of app developers. It has an interface that is elegant and well designed, and it provides a powerful object-mapping engine that integrates well with the CoreData database. RestKit for iOS will teach you everything from loading a simple list of objects to creating a fully-featured app.<br /><br />RestKit for iOS delivers constructive tools and insights into app development that will benefit any app developer. The book starts with a simple example and then moves on to more complex ones as your knowledge increases. By the end of the guide, you will be able to build a fully-featured app that uses RESTful web services and performs CRUD object manipulation.<br /><br />RestKit for iOS will provide you with all the information you need to boost the development process of both simple and complex apps. Once you have executed a simple example and reviewed the basic theory, you will move on to more advanced concepts with descriptions of real-life scenarios and how to overcome bottlenecks. RestKit for iOS is full of real-life examples that show you how to simplify data loading, basic and advanced object mapping, metadata mapping, and routing. This book also teaches you about routing, RESTful object manipulation and synchronization, integration with the user interface, and caching</p>
Table of Contents (13 chapters)

Entering data in forms


We already have our GenericTableViewController class for loading and showing objects; now let's see how we can make a kind-of-the-same controller for creating a new object or editing and delegating the existing objects.

You can create one from scratch using generic UIKit components, but we will do this with a library called QuickDialog. The example form created using this library is shown in the following screenshot:

Editing a Collection

First of all, you need to install it to your project. To do so, add pod 'QuickDialog' to your Podfile, and run pod install from a command line in the root of a project.

Let's call out the new controller, GenericFormViewController:

@interface GenericFormViewController : QuickDialogController

@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) NSString *itemPath;
@property (nonatomic, assign) id item;
@property (nonatomic, assign) BOOL shouldCreateNewItem;

- (BOOL)validateItemPassed;

// Interface actions
- (void...