<commit_before>//
//  ScheduleViewController.swift
//  Neekon
//
//  Created by <NAME> on 1/25/15.
//  Copyright (c) 2015 Iranican Inc. All rights reserved.
//

import UIKit
import Parse

class ScheduleViewController: UIViewController {

    @IBAction func calendarButtonPressed(sender: AnyObject) {
        
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        let titleImage = UIImage(named: "navigation-top-bar-logo")
        let titleView = UIImageView(image: titleImage)
        titleView.frame = CGRectMake(0, 0, 150, 40)
        titleView.contentMode = UIViewContentMode.ScaleAspectFit
        
        self.navigationItem.titleView = titleView
        
        self.view.backgroundColor = UIColor.clearColor()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
<commit_msg>Work in progress: adding event to you calendar<commit_after>//
//  ScheduleViewController.swift
//  Neekon
//
//  Created by <NAME> on 1/25/15.
//  Copyright (c) 2015 Iranican Inc. All rights reserved.
//

import UIKit
import EventKit
import Parse

class ScheduleViewController: UIViewController, UIAlertViewDelegate {

    @IBAction func calendarButtonPressed(sender: UIButton) {
        let store = EKEventStore()
        store.requestAccessToEntityType(EKEntityTypeEvent) { (granted:Bool, error:NSError!) in
            if granted {
                let event = EKEvent(eventStore: store)
                event.startDate = NSDate()
                event.allDay = true
                event.endDate = event.startDate.dateByAddingTimeInterval(24 * 60 * 60)
                event.title = "Neekon"
                event.location = "San Francisco"
                event.calendar = store.defaultCalendarForNewEvents
                var error:NSError?
                store.saveEvent(event, span: EKSpanThisEvent, commit: true, error: &error)
                
                let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .White)
                
                dispatch_async(dispatch_get_main_queue()) {
             
                    activityIndicator.frame = CGRect(
                        x: self.view.frame.width / 2,
                        y: self.view.frame.height / 2,
                        width: 40,
                        height: 40)
                
                    self.view.addSubview(activityIndicator)
                    activityIndicator.startAnimating()
                
                }
            
                dispatch_async(dispatch_get_main_queue()) {
                    let alert = UIAlertView(title: "Success!", message: "This event was successfully added to your calendar", delegate: self, cancelButtonTitle: "OK")
                    if error != nil {
                        alert.title = "Failure!"
                        alert.message = "There was a problem adding this event to your calendar"
                    }
                    activityIndicator.stopAnimating()
                    activityIndicator.hidden = true
                    alert.show()
                }
            }
        }
    }
    
    func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) {
        alertView.dismissWithClickedButtonIndex(buttonIndex, animated: true)
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        let titleImage = UIImage(named: "navigation-top-bar-logo")
        let titleView = UIImageView(image: titleImage)
        titleView.frame = CGRectMake(0, 0, 150, 40)
        titleView.contentMode = UIViewContentMode.ScaleAspectFit
        
        self.navigationItem.titleView = titleView
        
        self.view.backgroundColor = UIColor.clearColor()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}

{'fraction_non_alphanumeric': 0.08060948636028509, 'fraction_numerical': 0.010813467682477268, 'mean_word_length': 1.8621659634317862, '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': '2127905', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1025, 'n_words': 253}