Custom keyboards Auto- correction and Auto suggestion.

Hi All,

I am developing own custom keyboards. I am trouble with the auto-correction and auto-suggestion, it is not coming as per the default Apple keyboard. How can I implement Auto-correction and Autosuggestion as Apple default keyboard does?