yackle / CLImageEditor

MIT License
2.22k stars 574 forks source link

Multiple stickers option #109

Closed emiliomarin closed 9 years ago

emiliomarin commented 9 years ago

Would it be possible to have more than one stickers button when showing all the tools? So I could have one of them point at one image path and the other one would have different stickers. Thanks

yackle commented 9 years ago

You can achieve this purpose by creating a sub class of CLStickerTool.

for example:

CLStickerTool2.h

#import "CLStickerTool.h"

@interface CLStickerTool2 : CLStickerTool

@end

CLStickerTool2.m

#import "CLStickerTool2.h"

@implementation CLStickerTool2

+ (NSString*)defaultTitle
{
    return @"Stciekr2";
}

+ (NSString*)defaultIconImagePath
{
    return [[NSBundle mainBundle] pathForResource:@"yourIconName" ofType:@"png"];
}

+ (NSDictionary*)optionalInfo
{
    NSMutableDictionary *info = [super optionalInfo].mutableCopy;
    info[@"stickerPath"] = @"yourStickerPath";

    return info.copy;
}

@end