mirror of
https://github.com/jphong1111/awesome-ios-developer.git
synced 2025-02-23 21:23:42 +07:00
edit Image Picker
This commit is contained in:
parent
3e99206f1b
commit
fa56408bc1
@ -1,6 +1,5 @@
|
||||
//
|
||||
// ImagePicker.swift
|
||||
// VariousManagerDemoApp
|
||||
//
|
||||
// Created by JungpyoHong on 4/21/21.
|
||||
//
|
||||
@ -24,7 +23,6 @@ open class ImagePicker: NSObject {
|
||||
|
||||
self.presentationController = presentationController
|
||||
self.delegate = delegate
|
||||
|
||||
self.imagePicker.delegate = self
|
||||
self.imagePicker.allowsEditing = true
|
||||
self.imagePicker.mediaTypes = ["public.image"]
|
||||
@ -44,7 +42,6 @@ open class ImagePicker: NSObject {
|
||||
public func present(from sourceView: UIView) {
|
||||
|
||||
let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
|
||||
|
||||
if let action = self.action(for: .camera, title: "Take photo") {
|
||||
alertController.addAction(action)
|
||||
}
|
||||
@ -56,13 +53,6 @@ open class ImagePicker: NSObject {
|
||||
}
|
||||
|
||||
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
|
||||
|
||||
// if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
// alertController.popoverPresentationController?.sourceView = sourceView
|
||||
// alertController.popoverPresentationController?.sourceRect = sourceView.bounds
|
||||
// alertController.popoverPresentationController?.permittedArrowDirections = [.down, .up]
|
||||
// }
|
||||
|
||||
self.presentationController?.present(alertController, animated: true)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user