0

I am trying to import .db files using UIDocumentPickerViewController. Only need to show files with db extension (eg: sample.db) in document picker. There is an option to provide document type as Uniform Type Identifiers, but there is no UTIs found for db files. Is possible to create custom UTIs by checking extension. Providing sample code below,

      [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.db"]
                                                             inMode:UIDocumentPickerModeImport];

    documentPicker.delegate = self;
    [self presentViewController:documentPicker animated:YES completion:nil];

simulator screenshot

ajith Kumark
  • 333
  • 1
  • 3
  • 16
  • Do you mean https://developer.apple.com/documentation/uniformtypeidentifiers/defining_file_and_data_types_for_your_app ? – matt Aug 23 '22 at 04:04
  • Have you tried using the `database` type directly? https://developer.apple.com/documentation/uniformtypeidentifiers/uttype/3551483-database – Losiowaty Aug 23 '22 at 09:00
  • 1
    @Losiowaty tried public.database but unable pick files with extension .db and .sqlite – ajith Kumark Aug 24 '22 at 11:40

0 Answers0