You want to add image editing and drawing to your iOS app but don't have the time to do so? Look no further.
I've spent over 1500 hours making You Doodle the best drawing and art app on the app store. Integrating You Doodle into your own app is simple and does not require any 3rd party libraries or SDK.
To integrate You Doodle into your own iOS app, proceed with the following steps:
- (void) openImageInYouDoodle:(UIImage*)image
{
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"youdoodle://pasteboard-image"]])
{
// TODO: *IMPORTANT* Make sure to add your app's url scheme to your app's plist
// More info here: http://stackoverflow.com/questions/8201724
// TODO: Replace myappurlscheme and myappname with the appropriate values. Your app name will show up in
// You Doodle when the user goes to export their image and it will return to your app with
// the edited image
NSString* returnUrl = [@"myappurlscheme://pasteboard-image"
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString* appName = [@"myappname" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL* youDoodleURL = [NSURL URLWithString:[NSString stringWithFormat:
@"youdoodle://pasteboard-image?return-url=%@&return-text=%@", returnUrl, appName]];
// TODO: Replace MyAppIcon.png with the appropriate app icon for your app
// This image (and appName) will show in You Doodle when the users goes to export their image
UIImage* myAppIcon = [UIImage imageNamed:@"MyAppIcon.png"];
// TODO: Implement getImageFromMyApp which will read the current image from your app into a UIImage
UIImage* image = [self getImageFromMyApp];
[[UIPasteboard pasteboardWithName:@"private" create:YES] setImages:@[ image, myAppIcon]];
[[UIApplication sharedApplication] openURL:tmp];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://bit.ly/YouDoodleApp"]];
}
}
(BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
// TODO: Replace myappurlscheme with your app's url scheme
if ([url.absoluteString hasPrefix:@"myappurlscheme"] && [url.host isEqualToString:@"pasteboard-image"])
{
NSArray* images = [[UIPasteboard pasteboardWithName:@"private" create:NO] images];
UIImage* image = (images.count> 0 ? images[0] : nil);
if (image != nil)
{
// TODO: Take image and put it somewhere in your app
}
return YES;
}
}