<commit_before>//
//  Copyright © 2014 Yalantis
//  Licensed under the MIT license: http://opensource.org/licenses/MIT
//  Latest version can be found at http://github.com/yalantis/Side-Menu.iOS
//

import UIKit
import ObjectiveC

private var key = 0

class MenuSegue: UIStoryboardSegue {
    override init(identifier: String!, source: UIViewController, destination: UIViewController) {
        assert(destination is Menu, "Destination must conform to \(NSStringFromProtocol(Menu)) protocol")
        super.init(identifier: identifier, source: source, destination: destination)
    }

    override func perform() {
        let source = sourceViewController as UIViewController
        let target = destinationViewController as UIViewController

        target.modalPresentationStyle = .Custom
        target.transitioningDelegate = self

        source.presentViewController(target, animated: true, completion: nil)
    }
}

extension MenuSegue: UIViewControllerTransitioningDelegate {
    func animationControllerForPresentedController(presented: UIViewController, presentingController _: UIViewController,
        sourceController _: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        
        objc_setAssociatedObject(presented, &key, self, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        return MenuTransitionAnimator(.Presentation)
    }

    func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        dispatch_async(dispatch_get_main_queue()) {
            objc_setAssociatedObject(dismissed, &key, nil, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
        return MenuTransitionAnimator(.Dismissal)
    }<commit_msg>make MenuSegue public for R.swift integration<commit_after>//
//  Copyright © 2014 Yalantis
//  Licensed under the MIT license: http://opensource.org/licenses/MIT
//  Latest version can be found at http://github.com/yalantis/Side-Menu.iOS
//

import UIKit
import ObjectiveC

private var key = 0

public class MenuSegue: UIStoryboardSegue {
    override init(identifier: String!, source: UIViewController, destination: UIViewController) {
        assert(destination is Menu, "Destination must conform to \(NSStringFromProtocol(Menu)) protocol")
        super.init(identifier: identifier, source: source, destination: destination)
    }

    public override func perform() {
        let source = sourceViewController as UIViewController
        let target = destinationViewController as UIViewController

        target.modalPresentationStyle = .Custom
        target.transitioningDelegate = self

        source.presentViewController(target, animated: true, completion: nil)
    }
}

extension MenuSegue: UIViewControllerTransitioningDelegate {
    public func animationControllerForPresentedController(presented: UIViewController, presentingController _: UIViewController,
        sourceController _: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        
        objc_setAssociatedObject(presented, &key, self, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        return MenuTransitionAnimator(.Presentation)
    }

    public func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        dispatch_async(dispatch_get_main_queue()) {
            objc_setAssociatedObject(dismissed, &key, nil, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
        return MenuTransitionAnimator(.Dismissal)
    }
{'fraction_non_alphanumeric': 0.07158899494665918, 'fraction_numerical': 0.002807411566535654, 'mean_word_length': 4.341829085457271, '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': '2938365', 'n_tokens_mistral': 961, 'n_tokens_neox': 884, 'n_words': 211}