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:
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...