There are many libraries availble. You can use any of them.
Hope it helps you.
NOTE:
if you download openears (which contains a sample project called “OpenEarsSampleApp”) @efimovD mentions this
Check the code in view controller and you will see an array with
possible commands. This thing detects commands! Not some talk. It
listens and tries to compare what you’ve said with the words from
array