<commit_before>//
//  PhotoBrowserProtocols.swift
//  JanePhotoBrowser
//
//  Copyright © 2016 Jane. All rights reserved.
//

import UIKit

protocol PhotoBrowserDataSource:class {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoAtIndex index: Int) -> UIImage
    func numberOfPhotos(photoBrowser:PhotoBrowserView) -> Int
}

protocol PhotoBrowserDelegate:class {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoTappedAtIndex indexPath:NSIndexPath)
    func closeButtonTapped()
}

//Provide default implementation for UIViewController delegates
extension PhotoBrowserDelegate where Self: UIViewController {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoTappedAtIndex indexPath:NSIndexPath) {
        
    }
    func closeButtonTapped() {
        self.dismissViewControllerAnimated(true, completion: nil)
    }
}
<commit_msg>protocol extension for tapping a photo<commit_after>//
//  PhotoBrowserProtocols.swift
//  JanePhotoBrowser
//
//  Copyright © 2016 Jane. All rights reserved.
//

import UIKit

protocol PhotoBrowserDataSource:class {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoAtIndex index: Int) -> UIImage
    func numberOfPhotos(photoBrowser:PhotoBrowserView) -> Int
}

protocol PhotoBrowserDelegate:class {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoTappedAtIndex indexPath:NSIndexPath)
    func closeButtonTapped()
}

//Provide default implementation for UIViewController delegates
extension PhotoBrowserDelegate where Self: UIViewController {
    func photoBrowser(photoBrowser:PhotoBrowserView, photoTappedAtIndex indexPath:NSIndexPath) {
        let photoBrowserViewController:PhotoBrowserViewController = PhotoBrowserViewController()
        self.presentViewController(photoBrowserViewController, animated: true, completion: nil)
    }
    func closeButtonTapped() {
        self.dismissViewControllerAnimated(true, completion: nil)
    }
}

{'fraction_non_alphanumeric': 0.07355242566510173, 'fraction_numerical': 0.004173187271778821, 'mean_word_length': 5.167202572347267, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4333677', 'n_tokens_mistral': 510, 'n_tokens_neox': 475, 'n_words': 115}