From a77c60eed3ab4155b2466cf6eb54e23e97a6855b Mon Sep 17 00:00:00 2001 From: Rishabh Tayal Date: Tue, 21 Feb 2017 13:19:00 -0600 Subject: [PATCH 1/5] changed access from public to open --- .../ViewController/CameraViewController.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index e3b12000..65dcb5f1 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -42,7 +42,7 @@ public extension CameraViewController { } } -public class CameraViewController: UIViewController { +open class CameraViewController: UIViewController { var didUpdateViews = false var allowCropping = false @@ -172,11 +172,11 @@ public class CameraViewController: UIViewController { NotificationCenter.default.removeObserver(self) } - public override var prefersStatusBarHidden: Bool { + open override var prefersStatusBarHidden: Bool { return true } - public override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { + open override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { return UIStatusBarAnimation.slide } @@ -185,7 +185,7 @@ public class CameraViewController: UIViewController { * and add the views on this superview. Then, request * the update of constraints for this superview. */ - public override func loadView() { + open override func loadView() { super.loadView() view.backgroundColor = UIColor.black [cameraView, @@ -206,7 +206,7 @@ public class CameraViewController: UIViewController { * Any other dynamic constraint are configurable when the * device is rotating, based on the device orientation. */ - override public func updateViewConstraints() { + override open func updateViewConstraints() { if !didUpdateViews { configCameraViewConstraints() @@ -259,7 +259,7 @@ public class CameraViewController: UIViewController { * Configure the camera focus when the application * start, to avoid any bluried image. */ - public override func viewDidLoad() { + open override func viewDidLoad() { super.viewDidLoad() addCameraObserver() addRotateObserver() @@ -272,7 +272,7 @@ public class CameraViewController: UIViewController { /** * Start the session of the camera. */ - public override func viewWillAppear(_ animated: Bool) { + open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) cameraView.startSession() } @@ -281,7 +281,7 @@ public class CameraViewController: UIViewController { * Enable the button to take the picture when the * camera is ready. */ - public override func viewDidAppear(_ animated: Bool) { + open override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if cameraView.session?.isRunning == true { notifyCameraReady() @@ -291,7 +291,7 @@ public class CameraViewController: UIViewController { /** * This method will disable the rotation of the */ - override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) lastInterfaceOrientation = UIApplication.shared.statusBarOrientation if animationRunning { From 4869374e597b6d4e16143d3788c7d632c2f5e582 Mon Sep 17 00:00:00 2001 From: Rishabh Tayal Date: Tue, 21 Feb 2017 16:54:06 -0600 Subject: [PATCH 2/5] changed on completion as open --- .../ViewController/CameraViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index 65dcb5f1..d0902134 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -49,7 +49,7 @@ open class CameraViewController: UIViewController { var animationRunning = false var lastInterfaceOrientation : UIInterfaceOrientation? - var onCompletion: CameraViewCompletion? + open var onCompletion: CameraViewCompletion? var volumeControl: VolumeControl? var animationDuration: TimeInterval = 0.5 From 069fc6fb7e0210e9e50a07a545b76a95beb30354 Mon Sep 17 00:00:00 2001 From: Rishabh Tayal Date: Tue, 21 Feb 2017 17:00:52 -0600 Subject: [PATCH 3/5] close as open --- .../ViewController/CameraViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index d0902134..f0b9ffbd 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -497,7 +497,7 @@ open class CameraViewController: UIViewController { .save() } - internal func close() { + open func close() { onCompletion?(nil, nil) } From 6cc5224396add2d2f4a6ea7c3db8a3021977d69e Mon Sep 17 00:00:00 2001 From: Rishabh Tayal Date: Tue, 21 Feb 2017 17:09:16 -0600 Subject: [PATCH 4/5] commit --- .../ViewController/CameraViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index f0b9ffbd..7e44209c 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -10,7 +10,7 @@ import UIKit import AVFoundation import Photos -public typealias CameraViewCompletion = (UIImage?, PHAsset?) -> Void +open typealias CameraViewCompletion = (UIImage?, PHAsset?) -> Void public extension CameraViewController { public class func imagePickerViewController(croppingEnabled: Bool, completion: @escaping CameraViewCompletion) -> UINavigationController { @@ -497,7 +497,7 @@ open class CameraViewController: UIViewController { .save() } - open func close() { + internal func close() { onCompletion?(nil, nil) } From 160c4383f97aa40482d10d66aa96b9eb04d75cb1 Mon Sep 17 00:00:00 2001 From: Rishabh Tayal Date: Tue, 21 Feb 2017 17:09:30 -0600 Subject: [PATCH 5/5] commit --- .../ViewController/CameraViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index 7e44209c..d0902134 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -10,7 +10,7 @@ import UIKit import AVFoundation import Photos -open typealias CameraViewCompletion = (UIImage?, PHAsset?) -> Void +public typealias CameraViewCompletion = (UIImage?, PHAsset?) -> Void public extension CameraViewController { public class func imagePickerViewController(croppingEnabled: Bool, completion: @escaping CameraViewCompletion) -> UINavigationController {