<commit_before><commit_msg>add lazy fade in, out<commit_after>//
//  KZUIView.swift
//  EnvatoMiner
//
//  Created by <NAME> on 6/13/15.
//  Copyright (c) 2015 Debokeh. All rights reserved.
//

import Foundation

extension UIView {
    
    func doAlpha(value:Double) -> UIView {
        self.alpha = CGFloat(value)
        return self
    }
    
    func fadeIn(duration:Double, delay: Double = 0, completion: ((Bool) -> Void)? = nil) {
        UIView.animateWithDuration(duration, delay: delay, options:.CurveEaseOut, animations: {
            self.alpha = 1
        }, completion: completion)
    }
    
    func fadeOut(duration:Double, delay: Double = 0, completion: ((Bool) -> Void)? = nil) {
        UIView.animateWithDuration(duration, delay: delay, options:.CurveEaseOut, animations: {
            self.alpha = 0
            }, completion: completion)
    }
}
{'fraction_non_alphanumeric': 0.12903225806451613, 'fraction_numerical': 0.014976958525345621, 'mean_word_length': 2.546938775510204, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1917714', 'n_tokens_mistral': 284, 'n_tokens_neox': 266, 'n_words': 66}