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 LicenseConfiguration object.
  • Do not call super’s implementation. Doing that will throw an exception.
  • This method gets invoked as soon as -viewDidLoad is invoked. Initialize any dependency needed by this method in -viewDidLoad before calling super ’s implementation.
  • View KeyboardConfiguration to understand all the different configurations that may be applied.

If something needs to be added or if you find an error in our documentation, please let us know either on our GitHub or Discord.

Last updated on February 1, 2024