How to get started
The SpeechKit Mobile SDK for the iOS platform is distributed as a static library that is available in the CocoaPods repository.
- Step 1. Install CocoaPods
- Step 2. Add the library to your project
- Step 3. Configure the library
- Step 4. Build and run the app
Step 1. Install CocoaPods
Install the CocoaPods dependency management system:
$ sudo gem install cocoapods
Step 2. Add the library to your project
Go to the directory with the Xcode project (the directory where the file with the xcodeproj extension is located).
$ pod init
Open the Podfile and add the dependency:
pod 'YandexSpeechKit', '2.5.0'Note.
You can also specify '~> 2.5' instead of the version number. This means that the project will use the library version 2.5.0 or newer minor versions, if they exist in the repository. If you only set
pod 'YandexSpeechKit'in the Podfile, the latest version of the library will be used.
Specify the platform and the minimum version:
platform :ios, '6.0'
To apply the changes, run this command in the project directory:
$ pod installNote.
In the future, you can use the pod update command to update the library version.
After this, a file with the xcworkspace extension appears in the project folder. This is the file you should use for working on the project. Don't use the file with the xcodeproj extension. To open the project file, run the command:
$ open *.xcworkspace
Step 3. Configure the library
To use the library in the app, it must be configured (initialized with the specified parameters). Open xcworkspace and make the following changes:
Step 4. Build and run the app
Build the app. To launch it, you can use:
An iOS device connected to the developer's computer via USB.
Choose Product → Destination in the menu, then select the device in the Device section.
Choose Product → Destination in the menu, then select a simulator in the iOS Simulators section.
Run the app. To do this, choose Product → Run in the menu.
Did something go wrong?
Take a look at the sample project.