Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/summerblue/baidu-translate-ios-sdk
百度翻译 iOS SDK (非官方)
https://github.com/summerblue/baidu-translate-ios-sdk
Last synced: 22 days ago
JSON representation
百度翻译 iOS SDK (非官方)
- Host: GitHub
- URL: https://github.com/summerblue/baidu-translate-ios-sdk
- Owner: summerblue
- License: other
- Created: 2015-01-04T14:09:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-05T00:14:50.000Z (almost 10 years ago)
- Last Synced: 2023-03-23T08:37:12.450Z (over 1 year ago)
- Language: Objective-C
- Size: 137 KB
- Stars: 46
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## 说明
非官方 [百度翻译 API](http://developer.baidu.com/wiki/index.php?title=%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3%E9%A6%96%E9%A1%B5/%E7%99%BE%E5%BA%A6%E7%BF%BB%E8%AF%91/%E7%BF%BB%E8%AF%91API) iOS SDK.
## Credits
* [AFNetworking 2.0](https://github.com/AFNetworking/AFNetworking)
* [Mantle](https://github.com/MantleFramework/Mantle)## 截图
![](http://ww3.sinaimg.cn/large/6d86d850gw1enxudteorhj20ai0i074j.jpg)
## 使用
使用 Cocoapod 安装:
pod 'BaiduTranslate', :git => "https://github.com/summerblue/baidu-translate-ios-sdk.git"
## 使用```ojective-c
#warning 这里填写百度 API 的 KEY
[BaiduTranslate setupBaiduClientKey:@"REPLACE ME WITH KEY"];BTResultBlock callback = ^(TranslationEntity *translation, NSError *error) {
if (!error)
{
if (translation)
{
self.textView.text = translation.result;
NSLog(@"Translation Result --> %@", translation);
}
}
else
{
NSLog(@"------------ Translate, Error Occur -----------");
NSLog(@"-- Error %@", error);
}
};[BaiduTranslate translate:@"今天天气不错." callback:callback];
```
## 实例代码
```
$ git clone https://github.com/summerblue/baidu-translate-ios-sdk.git
$ cd baidu-translate-ios-sdk/
$ pod install
```pod 安装成功后
```
$ open BaiduTranslateExample.xcworkspace
```## License
Under the MIT license. See the LICENSE file for more info.