<commit_before>//
//  UIApplication.swift
//  TVNExtensions
//
//  Created by <NAME> on 5/23/18.
//

import Foundation

extension UIApplication {
    public class func isAppUpdated() -> Bool {
        if let oldAppVersion = UserDefaults.standard.value(forKey: "AppVersion") as? String {
            let isUpdated = Double(oldAppVersion)! < Double(appVersion())! ? true : false
            if isUpdated { saveAppVersion() }
            return isUpdated
        } else {
            saveAppVersion()
            return true
        }
    }
    
    private class func saveAppVersion() {
        UserDefaults.standard.setValue(appVersion(), forKey:"AppVersion")
        UserDefaults.standard.synchronize()
    }
    
    public class func appVersion() -> String {
        return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
    }<commit_msg>Update resource<commit_after>//
//  UIApplication.swift
//  TVNExtensions
//
//  Created by <NAME> on 5/23/18.
//

import Foundation

extension UIApplication {
    public class func requestNotificationRegister(settingTypes: UIUserNotificationType = [.badge, .sound, .alert]) {
        let notificationSettings = UIUserNotificationSettings(types: settingTypes, categories: nil)
        UIApplication.shared.registerUserNotificationSettings(notificationSettings)
    }
    
    public class func isAppUpdated() -> Bool {
        if let oldAppVersion = UserDefaults.standard.value(forKey: "AppVersion") as? String {
            let isUpdated = Double(oldAppVersion)! < Double(appVersion())! ? true : false
            if isUpdated { saveAppVersion() }
            return isUpdated
        } else {
            saveAppVersion()
            return true
        }
    }
    
    private class func saveAppVersion() {
        UserDefaults.standard.setValue(appVersion(), forKey:"AppVersion")
        UserDefaults.standard.synchronize()
    }
    
    public class func appVersion() -> String {
        return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
    }
{'fraction_non_alphanumeric': 0.09932170542635659, 'fraction_numerical': 0.0048449612403100775, 'mean_word_length': 2.680926916221034, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1649260', 'n_tokens_mistral': 559, 'n_tokens_neox': 539, 'n_words': 128}