Upvote:1

Aprove answer
if ([validExtensions containsObject:someExtension])
{
  // navigate to the photo detail / @"PhotoDetailView" view
} else {
  // navigate to the detail / @"My Files" view
}

Upvote:1

//assume fileURL is an NSURL pointing to the file to test
NSString* fileUTI = nil;
NSError* error;
if(![fileURL getResourceValue:&UTIString forKey:NSURLTypeIdentifierKey error:&error])
{
    //handle error
    return;
}
if(UTTypeConformsTo((__bridge CFStringRef)fileUTI, CFSTR("public.image"))
{
    NSLog(@"File at %@ is an image", fileURL);
}

Credit Goes to: stackoverflow.com

Related question with same questions but different answers