Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgn/shapecatcherkit
An Objective-CFramework for the shapecatcher.com api
https://github.com/kgn/shapecatcherkit
Last synced: about 1 month ago
JSON representation
An Objective-CFramework for the shapecatcher.com api
- Host: GitHub
- URL: https://github.com/kgn/shapecatcherkit
- Owner: kgn
- License: mit
- Created: 2012-01-24T07:40:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-04-02T23:27:59.000Z (over 12 years ago)
- Last Synced: 2023-03-11T10:28:08.118Z (over 1 year ago)
- Language: Objective-C
- Homepage: http://shapecatcher.com
- Size: 399 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
**ShapecatcherKit** is an Objective-C framework for [shapecatcher.com](http://shapecatcher.com) that provides full support for the API to recognize unicode shapes from drawings and rate the results.
![](https://github.com/kgn/ShapecatcherKit/raw/master/Screenshot.png)
*Please note the sample app does not include drawing code, it's purpose is only to demonstrate how to use the api.*
*Also `ShapecatcherKitTestApiKey.h` is referenced from the sample app but missing from the project because it
contains my private api key, you will need to request your own :)*# How to…
The sample application included with this project demonstrates how to fully use the API but here are some code snippets.
First set your api key on the `sharedKit`:
``` obj-c
[[ShapecatcherKit sharedKit] setApiKey:@""];
```Then you can recognize `NSImage`s asynchronously:
``` obj-c
[[ShapecatcherKit sharedKit] recognizeFromImage:image withSuccess:^(NSArray *shapes){
NSLog(@"%@", shapes);
} andFailure:nil];
```The `shapes` array contains `SKShape` objects with all the data from the api. This object also allows you to asynchronously request an image of the shape and rate how well the shape matches the drawing:
``` obj-c
[shape requestCharacterImageWithSuccess:^(NSImage *image){
NSLog(@"%@", image);
} andFailure:nil];
`````` obj-c
[shape setRating:SKShapeGoodRating withSuccess:^(){
NSLog(@"%@", image);
} andFailure:nil];
```Shapes can be rated *good*(`SKShapeGoodRating`) *bad*(`SKShapeBadRating`) or the previous rating can be undone with *undo*(`SKShapeUndoRating`).
---
**ShapecatcherKit** is available under the MIT license. See the LICENSE file for more info.
**ShapecatcherKit** is built on top of [AFNetworking](https://github.com/AFNetworking/AFNetworking) and [JSONKit](https://github.com/johnezang/JSONKit).