Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Camera Auth #201

Open
Faydee1220 opened this issue Aug 17, 2017 · 1 comment
Open

Check Camera Auth #201

Faydee1220 opened this issue Aug 17, 2017 · 1 comment

Comments

@Faydee1220
Copy link

Faydee1220 commented Aug 17, 2017

How about to add func checkCameraAuth() like checkPhotoAuth() ?

For example, when user don't allow photo permission first time, there's a protocol FSAlbumViewDelegate has func albumViewCameraRollUnauthorized(), then I can show alert that user can go to setting and grant permission of taking photo.

But it seems like there's no similiar func for camera?

By the way, I still get warning when use example's way to preset, and I found the solution in stackoverflow:

// Utility function to avoid:
// Warning: Attempt to present * on * whose view is not in the window hierarchy!

    func showAlertGlobally(_ alert: UIAlertController) {
        let alertWindow = UIWindow(frame: UIScreen.main.bounds)
        alertWindow.windowLevel = UIWindowLevelAlert
        alertWindow.rootViewController = UIViewController()
        alertWindow.makeKeyAndVisible()
        alertWindow.rootViewController?.present(alert, animated: true, completion: nil)
    }
@ytakzk
Copy link
Owner

ytakzk commented Aug 28, 2017

@Faydee1220 Good suggestion, thanks!
I will implement it soon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants