FKKeyboardViewController

This is the core class for the creation of your own custom keyboard.

KeyboardConfiguration instance will be called from KeyboardViewController.

The input method class that can be extended to configure the keyboard behaviour, respond to keyboard requests, and listen to keyboard events.

Notes:

  • The method createConfiguration will be called after the keyboard is created, as soon as @c -viewDidLoad is invoked. Here you should add all the different configurations for your custom keyboard.
class KeyboardViewController: FleksyKeyboardSDK.FKKeyboardViewController {
    
    /// - Important: Every time the keyboard appears it calls in this order: ``viewDidLoad`` -> ``viewWillAppear`` -> ``viewDidAppear``.
    /// Keyboard extensions don't reuse the view, which means that in every appearance we recreate what's inside ``viewDidLoad``.
    /// This behaviour is different from the normal iOS ViewController.
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    override func createConfiguration() -> KeyboardConfiguration {
      // Add all your custom configuration here.
      // Add your license key and secret here.
      let config = KeyboardConfiguration()
      return config
    }
  }

Summary

Event Description
createConfiguration Create startup configuration.

CreateConfiguration

override func createConfiguration() -> KeyboardConfiguration {
   let config = KeyboardConfiguration()
   return config
}

Notes:

  • This method must be overriden by subclasses to return a configuration containing, in particular, a valid @c LicenseConfiguration object.
  • Do not call super’s implementation. Doing that will throw an exception.
  • This method gets invoked as soon as @c -viewDidLoad is invoked. Initialize any dependency needed by this method in @c -viewDidLoad before calling @c super ’s implementation.
  • View KeyboardConfiguration to understand all the different configurations that may be applied.

Last updated on September 9, 2022