title: Upload video to Instagram via another app iOS
body: <p>I am trying to share video captured from my app to instagram but app crashes. Photos getting shared successfully.</p>
  
  <p>Code used:</p>
  
  <pre><code>     NSData* videoData = [NSData dataWithContentsOfURL:info[@"UIImagePickerControllerMediaURL"]];
       NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"instagram.igo"];
       [videoData writeToFile:path atomically:YES];
        NSURL *fileURL=[NSURL fileURLWithPath:path];
  
   NSDictionary *fileCaption = @{ @"InstagramCaption" : @"Shared by my app" };
  
       [self setDocumentInteractionController:[self setupControllerWithURL:fileURL usingDelegate:self]];
              [self.documentInteractionController setUTI:@"com.instagram.exclusivegram"];
              [self.documentInteractionController setAnnotation:fileCaption];
              [self.documentInteractionController presentOpenInMenuFromRect:rect inView:self.view animated:YES];
  </code></pre>
  
  <p>On capturing the video, my app redirects and opens Instagram app but immediately it crashes. </p>
  
  <p>Can someone help me with what I am doing wrong or tell me the correct method to share video to Instagram?</p>