<commit_before>//
//  JSViewController.swift
//  JSNavigationController
//
//  Created by <NAME> on 02/06/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import AppKit

public class JSViewController: NSViewController, JSNavigationBarViewControllerProvider {

	private static let navigationControllerPushIdentifier = "navigationControllerPush"
	private static let navigationBarViewControllerIdentifier = "navigationBarViewController"

	public private(set) var destinationViewController: NSViewController?
	public var navigationBarVC: NSViewController?
	public weak var navigationController: JSNavigationController?

	public func navigationBarViewController() -> NSViewController {
		guard let navigationBarVC = navigationBarVC else { fatalError("You must set the navigationBar view controller") }
		return navigationBarVC
	}

	// MARK: - View Lifecycle
	public override func awakeFromNib() {
		if self.dynamicType.instancesRespondToSelector(#selector(NSViewController.awakeFromNib)) {
			super.awakeFromNib()
		}
		setupSegues()
	}

	// MARK: - Segues
	private func setupSegues() {
		guard let segues = valueForKey("segueTemplates") as? [NSObject] else { return }
		for segue in segues {
			if let id = segue.valueForKey("identifier") as? String {
				performSegueWithIdentifier(id, sender: self)
			}
		}
	}

	public override func prepareForSegue(segue: NSStoryboardSegue, sender: AnyObject?) {
		guard let segueIdentifier = segue.identifier else { return }

		switch segueIdentifier {
		case JSViewController.navigationBarViewControllerIdentifier:
			navigationBarVC = segue.destinationController as? NSViewController
		case JSViewController.navigationControllerPushIdentifier:
			destinationViewController = segue.destinationController as? NSViewController
		default:
			return
		}
	}
}<commit_msg>Add destinationViewControllers property<commit_after>//
//  JSViewController.swift
//  JSNavigationController
//
//  Created by <NAME> on 02/06/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import AppKit

public class JSViewController: NSViewController, JSNavigationBarViewControllerProvider {

	private static let navigationControllerPushIdentifier = "navigationControllerPush"
	private static let navigationBarViewControllerIdentifier = "navigationBarViewController"

	public private(set) var destinationViewController: NSViewController?
	public private(set) var destinationViewControllers: [String: NSViewController] = [:]
	public var navigationBarVC: NSViewController?
	public weak var navigationController: JSNavigationController?

	public func navigationBarViewController() -> NSViewController {
		guard let navigationBarVC = navigationBarVC else { fatalError("You must set the navigationBar view controller") }
		return navigationBarVC
	}

	// MARK: - View Lifecycle
	public override func awakeFromNib() {
		if self.dynamicType.instancesRespondToSelector(#selector(NSViewController.awakeFromNib)) {
			super.awakeFromNib()
		}
		setupSegues()
	}

	// MARK: - Segues
	private func setupSegues() {
		guard let segues = valueForKey("segueTemplates") as? [NSObject] else { return }
		for segue in segues {
			if let id = segue.valueForKey("identifier") as? String {
				performSegueWithIdentifier(id, sender: self)
			}
		}
	}

	public override func prepareForSegue(segue: NSStoryboardSegue, sender: AnyObject?) {
		guard let segueIdentifier = segue.identifier else { return }

		switch segueIdentifier {
		case JSViewController.navigationBarViewControllerIdentifier:
			navigationBarVC = segue.destinationController as? NSViewController
		default:
			if segueIdentifier.containsString(JSViewController.navigationControllerPushIdentifier) {
				if segueIdentifier.characters.count > JSViewController.navigationControllerPushIdentifier.characters.count && segueIdentifier.characters.contains("#") {
					if let key = segueIdentifier.characters.split("#").map({ String($0) }).last {
						destinationViewControllers[key] = segue.destinationController as? NSViewController
					}
				} else {
					destinationViewController = segue.destinationController as? NSViewController
				}
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.08187560738581147, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 5.275914634146342, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '7553543', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1058, 'n_words': 282}