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:
AppDelegateclass and the
BalanceItemclass are in this directory.
AppDelegateclass is based on the template generated by Xcode and includes the methods for initialization of the Kii Cloud SDK and screen transitions.
BalanceItemclass defines symbols such as field names in the
KiiObjectin Kii Balance.
This 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
Tapping the "Register" button on the title screen displays the user registration screen implemented with the
This directory includes the classes for the data listing screen.
The data listing screen is implemented with the
BalanceListViewControllerclass. This class implements the
UITableViewDelegateprotocol and the
UITableViewDataSourceprotocol 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 the
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. The
DoneEditDelegateprotocol updates the list with the edited income and expense data.
This directory contains utility classes that are shared across the program.
This directory includes the
KiiAlertclass for displaying an alert and the
KiiProgressclass 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.
Let us review the implementation of the