title: iOS 8 Custom Keyboard
body: <p>I am trying to build a custom keyboard, it's like a emoji keyboard, but the keyboard's data is from a json file. After parse this json file and get the data, how to make the custom keyboard use it and show in the keyboard view, like the emoji keyboard that built in? Right now, I follow App Extension Keyboard: Custom Keyboard guide, and there only small bits of information here. Is there any tutorial or guide about how to create a custom emoji keyboard online? The current codes I am trying are below:</p>
  
  <pre><code>class KeyboardViewController: UIInputViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
  
          var error: NSError?
          let yanFile = NSBundle.mainBundle().pathForResource("yan", ofType: "json")
          let yanData = NSData(contentsOfFile: yanFile) as NSData
          let yanDict = NSJSONSerialization.JSONObjectWithData(yanData, options: NSJSONReadingOptions.MutableContainers, error: &amp;error) as NSDictionary
          println("dict: \(yanDict)") //print nothing in console
  
          // Perform custom UI setup here
          self.nextKeyboardButton = UIButton.buttonWithType(.System) as UIButton
  
          self.nextKeyboardButton.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), forState: .Normal)
  
      }
  }
  </code></pre>
  
  <p>The json like below:</p>
  
  <pre><code>{
      "list": 
      [
          {
              "tag": "laugh",
              "yan": 
              [
                  "o(*≧▽≦)ツ┏━┓",
                  "(/≥▽≤/)",
                  "ヾ(o◕∀◕)ﾉ"
              ]
          },
          {
              "tag": "wanna",
              "yan": 
              [
                  "✪ω✪",
                  "╰(*°▽°*)╯",
                  "≖‿≖✧",
                  "&gt;ㅂ&lt;",
                  "ˋ▽ˊ",
                  "✪ε✪",
                  "✪υ✪",
                  "ヾ (o ° ω ° O ) ノ゙",
                  "(｡◕ˇ∀ˇ◕）",
                  "（¯﹃¯）"
              ]
          }
      ]
  }
  </code></pre>