CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

PKCCheck 0.1.3

PKCCheck 0.1.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by pikachu987.



PKCCheck 0.1.3

  • By
  • pikachu987

PKCCheck

Example

To run the example project, clone the repo, and run pod install from the Example directory first.



  • import the PKCCheck header
import PKCCheck



  • ViewController
import PKCCheck

class ViewController: UIViewController{
  let pkcCheck = PKCCheck()
  override func viewDidLoad() {
        super.viewDidLoad()
        self.pkcCheck.delegate = self
    }
}



  • AudioAccessCheck
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()
    }
}



  • CameraAccessCheck
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()
    }
}



  • PhotoAccessCheck
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()
    }
}



  • PlugCheck
pkcCheck.plugAccessCheck()

extension ViewController: PKCCheckDelegate{
    func pkcCheckPlugIn() {
        print("plugIn")
    }

    func pkcCeckPlugOut() {
        print("plugOut")
    }
}



  • DecibelCheck
//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)")
    }
}



  • PermissionsChange
pkcCheck.permissionsChange()



  • Delegate All
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)")
    }
}





Requirements

Installation

PKCCheck is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PKCCheck"

Author

pikachu987, [email protected]

License

PKCCheck is available under the MIT license. See the LICENSE file for more info.