実装方法
MobileCoreServicesをimportする
import MobileCoreServices class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
mediaTypesをkUTTypeMovieにする
// 動画のみ if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) { let picker = UIImagePickerController() picker.delegate = self picker.sourceType = .photoLibrary picker.mediaTypes = [kUTTypeMovie as String] self.present(picker, animated: true, completion: nil) }
参考
https://developer.apple.com/documentation/mobilecoreservices MobileCoreServices https://developer.apple.com/documentation/coreservices/kuttypemovie https://qiita.com/jumpyoshim/items/7667e0cc81ad91016f03