我正在尝试使用YPImagePicker窗格将照片和视频从一个控制器发送到另一个。我在了解如何使用此文件时遇到问题。
lambda_0
我的第二个控制器具有如下代码。
var selectedItems = [YPMediaItem]()
let selectedImageV = UIImageView()
@objc func showPicker() {
var config = YPImagePickerConfiguration()
config.library.mediaType = .photoAndVideo
config.library.onlySquare = true
config.showsFilters = false
config.shouldSaveNewPicturesToAlbum = true
config.albumName = "RecipeSharing"
config.video.compression = AVAssetExportPresetMediumQuality
config.startOnScreen = .library
config.screens = [.library, .photo, .video]
config.video.recordingTimeLimit = 5.0
config.video.libraryTimeLimit = 500.0
config.video.trimmerMaxDuration = 60.0
config.video.trimmerMinDuration = 3.0
config.video.fileType = .mov
config.showsCrop = .rectangle(ratio: (16/9))
config.targetImageSize = YPImageSize.original
config.wordings.libraryTitle = "Gallery"
config.hidesStatusBar = false
config.hidesBottomBar = false
config.library.maxNumberOfItems = 5
let picker = YPImagePicker(configuration: config)
picker.didFinishPicking { [unowned picker] items, _ in
if let photo = items.singlePhoto {
let finalShareVC = NewInstructionsController()
picker.navigationController?.pushViewController(finalShareVC, animated: true)
}
}
picker.didFinishPicking { [unowned picker] items, _ in
if let video = items.singleVideo {
let finalShareVC = NewInstructionsController()
picker.navigationController?.pushViewController(finalShareVC, animated: true)
}
}
present(picker, animated: true, completion: nil)
}
这用于接收我相信的照片文件。有谁知道我必须使用什么来将照片和视频发送到另一个控制器以便可以使用。我尝试在此Pod上阅读很多东西。我进入此窗格中的save选项,然后它什么也不做。我想知道是否有人有想法或可以帮助我。也许我不需要推动观点,但是我不确定。谢谢。