<commit_before>//
//  ViewController.swift
//  Example
//
//  Created by kofktu on 2016. 7. 8..
//  Copyright © 2016년 Kofktu. All rights reserved.
//

import UIKit
import KUIActionSheet

class ViewController: UIViewController {

    @IBAction func onShowDefaultActionSheet(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self)
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowDefaultActionSheetWithCustomView(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self)
        
        let headerView = HeaderView(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: view.frame.size.width, height: 100.0)))
        headerView.backgroundColor = UIColor.red
        
//      with autolayout
//      headerView.translatesAutoresizingMaskIntoConstraints = false
//      headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 50.0))
        
        actionSheet?.add(customView: headerView)
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { [weak self] (item) in
            print(item.title)
            })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { [weak self] (item) in
            print(item.title)
            })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { [weak self] (item) in
            print(item.title)
            })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowCustomThemeActionSheet(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self, theme: KUIActionSheetDark())
        
        actionSheet?.cancelButton.backgroundColor = UIColor.black
        actionSheet?.cancelButton.setTitleColor(UIColor.white, for: [])
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowCustomXibActionSheet(_ sender: UIButton) {
        let actionSheet = CustomActionSheet.actionSheet(parentViewController: self)
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { [weak self] (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
}

public struct KUIActionSheetDark: KUIActionSheetProtocol {
    public var backgroundColor: UIColor {
        return UIColor(white: 0.0, alpha: 0.4)
    }
    
    public var showAnimationDuration: TimeInterval {
        return 0.25
    }
    <commit_msg>Sample warning fix<commit_after>//
//  ViewController.swift
//  Example
//
//  Created by kofktu on 2016. 7. 8..
//  Copyright © 2016년 Kofktu. All rights reserved.
//

import UIKit
import KUIActionSheet

class ViewController: UIViewController {

    @IBAction func onShowDefaultActionSheet(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self)
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowDefaultActionSheetWithCustomView(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self)
        
        let headerView = HeaderView(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: view.frame.size.width, height: 100.0)))
        headerView.backgroundColor = UIColor.red
        
//      with autolayout
//      headerView.translatesAutoresizingMaskIntoConstraints = false
//      headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 50.0))
        
        actionSheet?.add(customView: headerView)
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { (item) in
            print(item.title)
            })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { (item) in
            print(item.title)
            })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { (item) in
            print(item.title)
            })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowCustomThemeActionSheet(_ sender: UIButton) {
        let actionSheet = KUIActionSheet.view(parentViewController: self, theme: KUIActionSheetDark())
        
        actionSheet?.cancelButton.backgroundColor = UIColor.black
        actionSheet?.cancelButton.setTitleColor(UIColor.white, for: [])
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
    
    @IBAction func onShowCustomXibActionSheet(_ sender: UIButton) {
        let actionSheet = CustomActionSheet.actionSheet(parentViewController: self)
        
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴1", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴2", destructive: false) { (item) in
            print(item.title)
        })
        actionSheet?.add(item: KUIActionSheetItem(title: "메뉴3", destructive: false) { (item) in
            print(item.title)
        })
        
        actionSheet?.show()
    }
}

public struct KUIActionSheetDark: KUIActionSheetProtocol {
    public var backgroundColor: UIColor {
        return UIColor(white: 0.0, alpha: 0.4)
    }
    
    public var showAnimationDuration: TimeInterval {
        return 0.25
    }
    
{'fraction_non_alphanumeric': 0.11285350489210562, 'fraction_numerical': 0.010186302104275567, 'mean_word_length': 2.613559322033898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5090846', 'n_tokens_mistral': 2301, 'n_tokens_neox': 2286, 'n_words': 460}