This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CameraManager: NSObject { | |
static let shared: CameraManager = { | |
let instance = CameraManager() | |
return instance | |
}() | |
private var completions = [((UIImage?) -> Void, UIImagePickerController)]() | |
@discardableResult | |
func present(animated: Bool = true, on viewController: UIViewController? = nil, with completion: @escaping (UIImage?) -> Void) -> UIViewController? { | |
guard let vc = viewController ?? UIApplication.shared.keyWindow?.rootViewController else { |