11//
22// AvatarCaptureController.swift
3- // Tourre
3+ // AvatarCapture
44//
55// Created by John Murphy on 3/28/18.
6- // Copyright © 2018 Eye-Fi . All rights reserved.
6+ // Copyright © 2018 John Murphy . All rights reserved.
77//
88
99import UIKit
1010import QuartzCore
1111import AVFoundation
1212
13- protocol AvatarCaptureControllerDelegate : NSObjectProtocol {
13+ public protocol AvatarCaptureControllerDelegate : NSObjectProtocol {
1414 func imageSelected( image: UIImage )
1515 func imageSelectionCancelled( )
1616}
1717
1818open class AvatarCaptureController : UIViewController {
1919 @IBOutlet weak var apertureView : UIView !
2020
21- var delegate : AvatarCaptureControllerDelegate ?
21+ public var delegate : AvatarCaptureControllerDelegate ?
2222 var presentPickerImmediately = false
2323
24- var image : UIImage ?
24+ public var image : UIImage ?
2525 var isCapturing : Bool = false
2626
2727 var captureView : UIView ?
@@ -62,7 +62,7 @@ open class AvatarCaptureController: UIViewController {
6262 // Dispose of any resources that can be recreated.
6363 }
6464
65- @objc func startCapture( _ withLibraryPicker: Bool = false ) {
65+ @objc open func startCapture( _ withLibraryPicker: Bool = false ) {
6666 if isCapturing {
6767 return
6868 }
@@ -206,7 +206,7 @@ open class AvatarCaptureController: UIViewController {
206206 UIApplication . shared. setStatusBarHidden ( true , with: . slide)
207207 }
208208
209- func endCapture( ) {
209+ open func endCapture( ) {
210210 captureSession? . stopRunning ( )
211211 UIApplication . shared. setStatusBarHidden ( false , with: . slide)
212212 captureVideoPreviewLayer? . removeFromSuperlayer ( )
@@ -217,7 +217,7 @@ open class AvatarCaptureController: UIViewController {
217217 isCapturing = false
218218 }
219219
220- @objc func swapCameras( ) {
220+ @objc open func swapCameras( ) {
221221 if isCapturingImage != true {
222222 if captureDevice == AVCaptureDevice . devices ( for: . video) [ 0 ] {
223223 // rear active, switch to front
@@ -256,7 +256,7 @@ open class AvatarCaptureController: UIViewController {
256256 }
257257 }
258258
259- @objc func showImagePicker( ) {
259+ @objc open func showImagePicker( ) {
260260 picker = UIImagePickerController ( )
261261 picker? . sourceType = . photoLibrary
262262 picker? . delegate = self
0 commit comments