Category Archives: Featured

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

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.[1] 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).

Kanji Source

Source: © JMDict — property of the Electronic Dictionary Research and Development Group, used in conformance with the Group’s licence. Support the WWWJDIC project by donating.

 

Github repository

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 :

  1. KanjiQuiz
    • 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.
  2. 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
  3. KanjiQuiz Watch Application
    • This target contain WatchKit storyboard which is necessary for every Apple Watch application.
  4. AppLogic
    • 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.
  5. DataLogic
    • Learn basic KiiCloud integration
    • We use Realm (www.realm.io) as local persistence for it ease and simplicity.

 

How to set up the projects.

      1. After you download or checkout from github repository, open the XCode projects.
      2. Create Application on Kii developer portal.
        1. 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.
        2. Obtain Apps credentials from developer portal. Please refer to this page : http://docs.kii.com/en/guides/ios/quickstart/
        3. Only app ID, App Key and Server location is necessary.
      3. 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).Screen Shot 2015-04-14 at 3.19.10 PM
      4. Back to Developer portal. Create a new user with below guideline.
        • login : watchuser
        • password : kii12345
        • Display Name  << your prefered display name >>
        • Screen Shot 2015-04-14 at 3.33.10 PM
      5. Now you can gracefully build and run KanjiQuiz app target. Try on simulator first then you will see the main screen.
      6. Stop the runtime (CMD + .), then select KanjiQuiz WatchKit App target and push run. You will see Apple watch Simulator main screen.

KanjiQuiz Blog

 

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 !!