TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by pikachu987.
To run the example project, clone the repo, and run pod install
from the Example directory first.
import PKCCheck
import PKCCheck
class ViewController: UIViewController{
let pkcCheck = PKCCheck()
override func viewDidLoad() {
super.viewDidLoad()
self.pkcCheck.delegate = self
}
}
pkcCheck.audioAccessCheck()
extension ViewController: PKCCheckDelegate{
func pkcCheckAudioPermissionUndetermined() {
print("audioAccess: undetermined (first approach)")
}
func pkcCheckAudioPermissionGranted() {
print("audioAccess: granted")
}
func pkcCheckAudioPermissionDenied() {
print("audioAccess: denied")
self.pkcCheck.permissionsChange()
}
}
pkcCheck.cameraAccessCheck()
extension ViewController: PKCCheckDelegate{
func pkcCheckCameraPermissionUndetermined() {
print("cameraAccess: undetermined (first approach)")
}
func pkcCheckCameraPermissionGranted() {
print("cameraAccess: granted")
}
func pkcCheckCameraPermissionDenied() {
print("cameraAccess: denied")
self.pkcCheck.permissionsChange()
}
}
pkcCheck.photoAccessCheck()
extension ViewController: PKCCheckDelegate{
func pkcCheckPhotoPermissionUndetermined() {
print("photoAccess: undetermined (first approach)")
}
func pkcCheckPhotoPermissionGranted() {
print("photoAccess: granted")
}
func pkcCheckPhotoPermissionDenied() {
print("photoAccess: denied")
self.pkcCheck.permissionsChange()
}
}
pkcCheck.plugAccessCheck()
extension ViewController: PKCCheckDelegate{
func pkcCheckPlugIn() {
print("plugIn")
}
func pkcCeckPlugOut() {
print("plugOut")
}
}
//pkcCheck.minDecibelDegree = 45
//pkcCheck.maxDecibelDegree = 315
pkcCheck.decibelStart()
pkcCheck.decibelStop()
extension ViewController: PKCCheckDelegate{
func pkcCheckDecibel(_ level: CGFloat, average: CGFloat, degree: CGFloat, radian: CGFloat) {
}
func pkcCheckSoundErr(_ error: Error) {
print("sound error: \(error)")
}
}
pkcCheck.permissionsChange()
extension ViewController: PKCCheckDelegate{
func pkcCheckAudioPermissionUndetermined() {
print("audioAccess: undetermined (first approach)")
}
func pkcCheckAudioPermissionGranted() {
print("audioAccess: granted")
}
func pkcCheckAudioPermissionDenied() {
print("audioAccess: denied")
self.pkcCheck.permissionsChange()
}
func pkcCheckCameraPermissionUndetermined() {
print("cameraAccess: undetermined (first approach)")
}
func pkcCheckCameraPermissionGranted() {
print("cameraAccess: granted")
}
func pkcCheckCameraPermissionDenied() {
print("cameraAccess: denied")
self.pkcCheck.permissionsChange()
}
func pkcCheckPhotoPermissionUndetermined() {
print("photoAccess: undetermined (first approach)")
}
func pkcCheckPhotoPermissionGranted() {
print("photoAccess: granted")
}
func pkcCheckPhotoPermissionDenied() {
print("photoAccess: denied")
self.pkcCheck.permissionsChange()
}
func pkcCheckPlugIn() {
print("plugIn")
}
func pkcCeckPlugOut() {
print("plugOut")
}
func pkcCheckDecibel(_ level: CGFloat, average: CGFloat, degree: CGFloat, radian: CGFloat) {
}
func pkcCheckSoundErr(_ error: Error) {
print("sound error: \(error)")
}
}
PKCCheck is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "PKCCheck"
pikachu987, [email protected]
PKCCheck is available under the MIT license. See the LICENSE file for more info.