Class Structure
Kii Balance is designed using the following class structure. The same class names and structure are used in both Swift and Objective-C versions while only the Objective-C version has the main.c file that is omitted in the figure.
The classes with the stereotype <<iOS>> belong to the iOS SDK, the protocols with <<iOS, Protocol>> are iOS SDK protocols, and the class with <<Kii>> belongs to the Kii Cloud SDK. The classes whose background is pale blue are implemented in Kii Balance.

Each class corresponds to one of the screens of the user interface as shown in the figure below.

The classes are included in the directories below:
The
KiiBalancedirectoryThe
AppDelegateclass and theBalanceItemclass are in this directory.The
AppDelegateclass is based on the template generated by Xcode and includes the methods for initialization of the Kii Cloud SDK and screen transitions.The
BalanceItemclass defines symbols such as field names in theKiiObjectin Kii Balance.The
KiiBalance/TitledirectoryThis directory includes the classes for the title screen. The title screen is implemented with the
TitleViewControllerclass and configured to be displayed as the first screen in the storyboard.Tapping the "Login" button on the title screen displays the login screen implemented with the
LoginViewControllerclass.Tapping the "Register" button on the title screen displays the user registration screen implemented with the
RegisterViewControllerclass.The
KiiBalance/ListdirectoryThis directory includes the classes for the data listing screen.
The data listing screen is implemented with the
BalanceListViewControllerclass. This class implements theUITableViewDelegateprotocol and theUITableViewDataSourceprotocol and provides a user interface using a table view.The "Balance" row at the top of the table view is processed with a cell of the
TotalAmountTableViewCellclass. The list of income and expense items under the "Balance" row is processed with cells of theBalanceItemTableViewCellclass.When the "Add" button in the upper right of the screen or a cell in the table is tapped, the screen for adding or editing an entry is displayed.
The screen for adding or editing an entry is implemented with the
EditItemViewControllerclass. The Kii Cloud SDK adds, updates, and deletes data. TheDoneEditDelegateprotocol updates the list with the edited income and expense data.The
KiiBalance/AlertdirectoryThis directory contains utility classes that are shared across the program.
This directory includes the
KiiAlertclass for displaying an alert and theKiiProgressclass for indicating the progress of a task.
Key points for implementation of mobile apps are explained later in this tutorial. For the other parts, analyze the source code by using this topic as a reference.
What's Next?
Let us review the implementation of the AppDelegate class.