<commit_before>//
//  ViewController.swift
//  SwiftBlurEffect
//
//  Created by <NAME> on 18/07/14.
//  KiranPatel-iOS

import UIKit

class ViewController: UIViewController , UIGestureRecognizerDelegate{

    var blurEffectExtraLight : UIBlurEffect?
    var blurEffectLight : UIBlurEffect?
    var blurEffectDark : UIBlurEffect?

    var blurViewExtraLight : UIVisualEffectView?
    var blurViewLight : UIVisualEffectView?
    var blurViewDark : UIVisualEffectView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        //Set Extra Light Blur View
        blurEffectExtraLight = UIBlurEffect(style: UIBlurEffectStyle.ExtraLight)
        blurViewExtraLight = UIVisualEffectView(effect: blurEffectExtraLight)
        blurViewExtraLight!.frame = CGRectMake(10, 70, 300, 100)
        view.addSubview(blurViewExtraLight)
        
        
        //Set Light Blur View
        blurEffectLight = UIBlurEffect(style: UIBlurEffectStyle.Light)
        blurViewLight = UIVisualEffectView(effect: blurEffectLight)
        blurViewLight!.frame = CGRectMake(10, 220, 300, 100)
        view.addSubview(blurViewLight)

        //Set Dark Blur View
        blurEffectDark = UIBlurEffect(style: UIBlurEffectStyle.Dark)
        blurViewDark = UIVisualEffectView(effect: blurEffectDark)
        blurViewDark!.frame = CGRectMake(10, 370, 300, 100)
        view.addSubview(blurViewDark)
        
        //Adding Pan gesture on all blur view
        addPanGesture(blurViewExtraLight!)
        addPanGesture(blurViewLight!)
        addPanGesture(blurViewDark!)
        
        //Adding Information lable on all blur view
        addInfoLabel("iOS8 Extra Light Blur", blurViewToAdd: blurViewExtraLight!)
        addInfoLabel("iOS8 Light Blur", blurViewToAdd: blurViewLight!)
        addInfoLabel("iOS8 Dark Blur", blurViewToAdd: blurViewDark!)
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
/*-------------------------------------------- Custom Functions -------------------------------------------------*/
    
    //Function : Add Pan gesture on all blur view
    func addPanGesture(blurViewToAdd:UIVisualEffectView) {
        // Adding Pan gesture on blurview
        var panGesture : UIPanGestureRecognizer?
        panGesture = UIPanGestureRecognizer(target: self, action: "handlePan:")
        panGesture!.delegate = self
        blurViewToAdd.addGestureRecognizer(panGesture)
    }
    //Function : Pan Gesture Handler
    func handlePan(recognizer:UIPanGestureRecognizer) {
        view.bringSubviewToFront(recognizer.view)
        let translation = recognizer.translationInView(self.view)
        recognizer.view.center = CGPoint(x:recognizer.view.center.x + translation.x,
            y:recognizer.view.center.y + translation.y)
        recognizer.setTranslation(CGPointZero, inView: self.view)
    }
    
    //Function : Add Information lable on all blur view
    func addInfoLabel(sText:String , blurViewToAdd:UIVisualEffectView) {
        var labelExtraLight = UILabel(frame: CGRectMake(0, 0, 300, 100))
        labelExtraLight.font = UIFont.systemFontOfSize(20)<commit_msg>fix broken build by adding needed optionals unwrapping for 8.1<commit_after>//
//  ViewController.swift
//  SwiftBlurEffect
//
//  Created by <NAME> on 18/07/14.
//  KiranPatel-iOS

import UIKit

class ViewController: UIViewController , UIGestureRecognizerDelegate{

    var blurEffectExtraLight : UIBlurEffect?
    var blurEffectLight : UIBlurEffect?
    var blurEffectDark : UIBlurEffect?

    var blurViewExtraLight : UIVisualEffectView?
    var blurViewLight : UIVisualEffectView?
    var blurViewDark : UIVisualEffectView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        //Set Extra Light Blur View
        blurEffectExtraLight = UIBlurEffect(style: UIBlurEffectStyle.ExtraLight)
        blurViewExtraLight = UIVisualEffectView(effect: blurEffectExtraLight!)
        blurViewExtraLight!.frame = CGRectMake(10, 70, 300, 100)
        view.addSubview(blurViewExtraLight!)
        
        
        //Set Light Blur View
        blurEffectLight = UIBlurEffect(style: UIBlurEffectStyle.Light)
        blurViewLight = UIVisualEffectView(effect: blurEffectLight!)
        blurViewLight!.frame = CGRectMake(10, 220, 300, 100)
        view.addSubview(blurViewLight!)

        //Set Dark Blur View
        blurEffectDark = UIBlurEffect(style: UIBlurEffectStyle.Dark)
        blurViewDark = UIVisualEffectView(effect: blurEffectDark!)
        blurViewDark!.frame = CGRectMake(10, 370, 300, 100)
        view.addSubview(blurViewDark!)
        
        //Adding Pan gesture on all blur view
        addPanGesture(blurViewExtraLight!)
        addPanGesture(blurViewLight!)
        addPanGesture(blurViewDark!)
        
        //Adding Information lable on all blur view
        addInfoLabel("iOS8 Extra Light Blur", blurViewToAdd: blurViewExtraLight!)
        addInfoLabel("iOS8 Light Blur", blurViewToAdd: blurViewLight!)
        addInfoLabel("iOS8 Dark Blur", blurViewToAdd: blurViewDark!)
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
/*-------------------------------------------- Custom Functions -------------------------------------------------*/
    
    //Function : Add Pan gesture on all blur view
    func addPanGesture(blurViewToAdd:UIVisualEffectView) {
        // Adding Pan gesture on blurview
        var panGesture : UIPanGestureRecognizer?
        panGesture = UIPanGestureRecognizer(target: self, action: "handlePan:")
        panGesture!.delegate = self
        blurViewToAdd.addGestureRecognizer(panGesture!)
    }
    //Function : Pan Gesture Handler
    func handlePan(recognizer:UIPanGestureRecognizer) {
        view.bringSubviewToFront(recognizer.view!)
        let translation = recognizer.translationInView(self.view)
        recognizer.view!.center = CGPoint(x:recognizer.view!.center.x + translation.x,
            y:recognizer.view!.center.y + translation.y)
        recognizer.setTranslation(CGPointZero, inView: self.view)
    }
    
    //Function : Add Information lable on all blur view
    func addInfoLabel(sText:String , blurViewToAdd:UIVisualEffectView) {
        var labelExtraLight = UILabel(frame: CGRectMake(0, 0, 300, 100))
        labelExtraLight.font = UIFont.systemFontOfSize(20)
{'fraction_non_alphanumeric': 0.10589651022864019, 'fraction_numerical': 0.015643802647412757, 'mean_word_length': 2.7291082445316883, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7571463', 'n_tokens_mistral': 2041, 'n_tokens_neox': 1895, 'n_words': 426}