Latest 0.1.9
Homepage https://github.com/stampery/StamperyKit
License MIT
Platforms ios 8.0, requires ARC
Dependencies AFNetworking, SSKeychain, NSHash
Authors

CI Status
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

TODO

  • Tests. Tests. Tests!!
  • Caching
  • Persistence

Installation

StamperyKit is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "StamperyKit"

Usage

First, import the library:

#import <StamperyKit/StamperyKit.h>

Then, calling to the +sharedInstance method will initialize the library.

Examples

Login

NSString *emailString = @"[email protected]"
NSString *passwordString = @"[email protected]"

[[StamperyKit sharedInstance] loginWithEmail:emailString andPassword:passwordString completion:^(id response) {
    // Response contains the HTTP body
    // Once logged in, [[StamperyKit sharedInstance] userProfile] will contain the user profile
} errorBlock:^(NSError *error) {
    // error contains a NSError instance with the given error
}];

Sign up

NSString *emailString = @"[email protected]";
NSString *passwordString = @"[email protected]";
NSString *nameString = @"John Doe";

[[StamperyKit sharedInstance] registerWithEmail:emailString password:passwordString name:nameString completion:^(id response) {
    // Response contains the HTTP body
    // Once logged in, [[StamperyKit sharedInstance] userProfile] will contain the user profile
} errorBlock:^(NSError *error) {
    // error contains a NSError instance with the given error
}];

List stamps [needs login]

[[StamperyKit sharedInstance] listStampsWithCompletion:^(id response) {
    // Response will contain a NSArray containing 'Stamp' elements
} errorBlock:^(NSError * error) {
    // error contains a NSError instance with the given error
}];

Get stamp details

NSString *stampHash = @"xxx-xxx-xxx";

[[StamperyKit sharedInstance] detailsForStampHash:stampHash completion:^(id response) {
    // response has an instance of Stamp, containing the specified stamp info
} errorBlock:^(NSError *error) {
    // error contains the raised error
}];

Stamping
This part will change eventually to make the library less opinionated. For now you can only stamp a file, by creating a PreStamp instance

PreStamp *preStamp = [[PreStamp alloc] ...];
BOOL backupStamp = YES;

[[StamperyKit sharedInstance] stampFile:preStamp backupFile:backupStamp completion:^(id response) {
    // response contains the server response
} errorBlock:^(NSError *error) {
    // error contains the raised error
}];

These are the basic methods to start using basic functionality. Check StamperyKit.h for the full list of methods

Author

Pablo Merino, [email protected]

License

StamperyKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "StamperyKit",
    "version": "0.1.9",
    "summary": "Stampery's Cocoa Library",
    "description": "This is Stampery's Official Cocoa library.",
    "homepage": "https://github.com/stampery/StamperyKit",
    "license": "MIT",
    "authors": {
        "Pablo Merino": "[email protected]"
    },
    "source": {
        "git": "https://github.com/stampery/StamperyKit.git",
        "tag": "0.1.9"
    },
    "social_media_url": "https://twitter.com/StamperyCo",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "StamperyKit": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h",
    "dependencies": {
        "AFNetworking": [
            "~> 2.3"
        ],
        "SSKeychain": [],
        "NSHash": []
    }
}

Pin It on Pinterest

Share This