 import CoreLocation
 import AddressBook
 import AssetsLibrary
+import AVFoundation
 
 public enum PresentDialogResult: String {
     case NoAction = "No Action"

    }
}

// ???: Twitter
// ???: Facebook


            completion?(granted: true, userDialogResult: .NoAction, systemDialogResult: .NoAction)
        }
    }
    
    public func showCameraPermission(title: String? = "Allow Camera Access?", message: String?, var denyButtonTitle: String?, var grantButtonTitle: String?, completion: PermissionCompletionHandler?) {
        denyButtonTitle = self.title(denyButtonTitle, forTitleType: .Deny)
        grantButtonTitle = self.title(grantButtonTitle, forTitleType: .Request)
        
        var authorizationStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)
        if authorizationStatus == AVAuthorizationStatus.NotDetermined {
            self.showAlertView(
                title!,
                message: message!,
                denyButtonTitle: denyButtonTitle!,
                grantButtonTitle: grantButtonTitle!,
                denyAction: {
                    self.fireCameraCompletionHandler(completion)
                }, grantAction: {
                    self.showCameraSystemAlert(completion)
                })
        }
    }
    
    public func showMicrophonePermission(title: String? = "Allow Microphone Access?", message: String?, var denyButtonTitle: String?, var grantButtonTitle: String?, completion: PermissionCompletionHandler?) {
        denyButtonTitle = self.title(denyButtonTitle, forTitleType: .Deny)
        grantButtonTitle = self.title(grantButtonTitle, forTitleType: .Request)
        
        var authorizationStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeAudio)
        if authorizationStatus == AVAuthorizationStatus.NotDetermined {
            self.showAlertView(
                title!,
                message: message!,
                denyButtonTitle: denyButtonTitle!,
                grantButtonTitle: grantButtonTitle!,
                denyAction: {
                    println("Fire the microphone completion handler")
                    self.fireCameraCompletionHandler(completion)
                }, grantAction: {
                    println("Show the microphone system alert")
                    self.showMicrophoneSystemAlert(completion)
                })
        }
    }
}

// MARK: - Photos
