<commit_before>//
//  PHPhotoLibrary+Helpers.swift
//  Ardhi
//
//  Created by <NAME> on 2/1/16.
//  Copyright © 2016 Solutions 4 Mobility. All rights reserved.
//

import Photos

extension PHPhotoLibrary {
    /** Checks and asks (if needed) Photo library permissions  */
    class func isAuthorized(completion:(authorized:Bool) -> Void) {
        PHPhotoLibrary.requestAuthorization { status in
            switch status {
            case .Authorized:
                completion(authorized: true)
            default:
                completion(authorized: false)
            }
        }
    }
}<commit_msg>PHPhotoLibrary fix<commit_after>//
//  PHPhotoLibrary+Helpers.swift
//  Ardhi
//
//  Created by <NAME> on 2/1/16.
//  Copyright © 2016 Solutions 4 Mobility. All rights reserved.
//

import Photos

extension PHPhotoLibrary {
    /** Checks and asks (if needed) Photo library permissions  */
    class func isAuthorized(completion:(authorized:Bool) -> Void) {
        PHPhotoLibrary.requestAuthorization { status in
            dispatch_async(dispatch_get_main_queue(),{
                switch status {
                case .Authorized:
                    completion(authorized: true)
                default:
                    completion(authorized: false)
                }
            })
        }
    }
}
{'fraction_non_alphanumeric': 0.09628506444275967, 'fraction_numerical': 0.013646702047005308, 'mean_word_length': 1.907488986784141, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4808126', 'n_tokens_mistral': 372, 'n_tokens_neox': 340, 'n_words': 92}