KanjiQuiz: An Apple Watch ready iOS 8 Quiz Application (Part 1)
Apple Watch is coming !!! Many developers around the world has already prepared for their awesome Watch Applications. Perhaps you are one of those, if not, this tech blog series will explore a minimalistic yet fully functioned iOS 8 applications with WatchKit capabilities.
KanjiQuiz is an application that train you to memorize Japanese Kanji characters. The characters categorized by the level of Japanese Language Proficiency Test (JLPT).
Based on wikipedia :
The Japanese-Language Proficiency Test(日本語能力試験 Nihongo Nōryoku Shiken?), or JLPT, is a standardized criterion-referenced test to evaluate and certify Japanese language proficiency for non-native speakers, covering language knowledge, reading ability, and listening ability. The test is held twice a year in Japan and selected countries (on the first Sunday of July and December), and once a year in other regions (on the first Sunday of December).
All the code that we will use on this blog is available on https://github.com/KiiPlatform/KanjiQuiz
App design and usage
The projects consist of 7 targets including unit tests. Below is simple explanations for target excluding unit tests :
- Main iOS application target. This target mostly handle UI parts, use storyboard as the flow.
- At this target you can learn some of UIKit technique like Core Animation, UIKit Dynamics and Custom animation transition.
- On this Target, KiiCloud initialization is called via embedded framework call.
- KanjiQuiz Watch App Extension
- This target handle UI on WatchKit. You can learn the basic UI on WatchKit, and make User Experience inline with iPhone main App.
- Some of UI technique is quite useful for beginner to determine InterfaceController behaviour which is quite different with UIViewControlller
- KanjiQuiz Watch Application
- This target contain WatchKit storyboard which is necessary for every Apple Watch application.
- The embedded framework that is covers application logic.
- This framework called by both Main App and WatchKit Extension. This architecture follow Apple guidelines for developing iOS 8 extensions.
- You can learn how to share KeyChain, NSUserDefaults , database file and code logic between App and the WatchKit
- Swift language feature like enumeration, extension, etc also covered in this target.
- Learn basic KiiCloud integration
- We use Realm (www.realm.io) as local persistence for it ease and simplicity.
How to set up the projects.
- After you download or checkout from github repository, open the XCode projects.
- Create Application on Kii developer portal.
- In case you don’t have Kii developer account, please register first. Don’t worry, it is free and does not need any credit card or any personal information other than email address.
- Obtain Apps credentials from developer portal. Please refer to this page : http://docs.kii.com/en/guides/ios/quickstart/
- Only app ID, App Key and Server location is necessary.
- Back to the XCode. Open KiiLogic.m on DataLogic targets then change the [Kii begin .. line with your newly created AppId,AppKey and site (kiiSiteJP for Japan, kiiSiteUS for US, kiiSiteCN for China and kiiSiteSG for Singapore).
- Back to Developer portal. Create a new user with below guideline.
- login : watchuser
- password : kii12345
- Display Name << your prefered display name >>
- Now you can gracefully build and run KanjiQuiz app target. Try on simulator first then you will see the main screen.
- Stop the runtime (CMD + .), then select KanjiQuiz WatchKit App target and push run. You will see Apple watch Simulator main screen.
Where we can go from here
If you are able to run the KanjiApps on simulator, or installed on your device, congratulations!! you have opportunity to learn an end to end WatchKit capable iOS8 applications. And of course, you can also learn Japanese kanji character by using the apps.
In further series, we will add more great functionality in step by step walkthrough.
Happy Coding !!