Instagram recently made a change to their API policy which allowed developers to post pictures to the Instagram platform via their own app. Several other techniques we\'re p
You can simply use UIActivityViewController as well,
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"instagram://app"]]) //check for App is install or not
{
NSArray * activityItems = [NSArray arrayWithObjects:newImage, nil];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityController.excludedActivityTypes = [NSArray arrayWithObjects:UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, nil];
[self presentViewController:activityController animated:YES completion:nil];
//after sent
[activityController setCompletionWithItemsHandler:^(NSString *act, BOOL done, NSArray *returnedItems, NSError *activityError){
if (done){
UIAlertController *alert;
UIAlertAction* ok = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action){
[alert dismissViewControllerAnimated:YES completion:nil];
}];
alert = [UIAlertController alertControllerWithTitle:@"Successfully Posted!" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction: ok];
[self presentViewController:alert animated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
}
}];
}