Swiftのhyperoslo/ImagePickerを使うと落ちます。
https://github.com/hyperoslo/ImagePicker
を使うと落ちます。
開発環境
Xcode 10.2 (10E125)
Deployment Target: 12.2
その他必要な情報があれば教えてください。
import UIKit
import ImagePicker
class ViewController: UIViewController, ImagePickerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func addBtnTapped(_ sender: Any) {
choosePicture()
}
@objc func choosePicture() {
let config = Configuration()
config.doneButtonTitle = "Finish"
config.noImagesTitle = "Sorry! There are no images here!"
config.recordLocation = false
config.allowVideoSelection = true
let imagePicker = ImagePickerController(configuration: config)
imagePicker.delegate = self
present(imagePicker, animated: true, completion: nil)//<-###ここで落ちる
}
// MARK: - ImagePickerDelegate
func cancelButtonDidPress(_ imagePicker: ImagePickerController) {
imagePicker.dismiss(animated: true, completion: nil)
}
func wrapperDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
guard images.count > 0 else { return }
print(images)
}
func doneButtonDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
imagePicker.dismiss(animated: true, completion: nil)
}
}