<commit_before>//
//  UIViewController+ChildViewControllers.swift
//  PeakFinder
//
//  Created by <NAME> on 4/25/16.
//  Copyright © 2016 Two Ring Software. All rights reserved.
//

import Cartography
import Foundation

extension UIViewController {

    func fillWithChildViewController(childViewController: UIViewController) {
        self.view.addSubview(childViewController.view)
        constrain(self.view, childViewController.view) { container, subview in
            subview.edges == container.edges
        }
        self.addChildViewController(childViewController)
    }

    func addChildViewController(childViewController childViewController: UIViewController) {
        self.view.addSubview(childViewController.view)
        self.addChildViewController(childViewController)
    }

    func removeChildViewController(childViewController childViewController: UIViewController) {
        childViewController.view.removeFromSuperview()
        childViewController.removeFromParentViewController()
    }

}<commit_msg>rewrite view controller extensions to not collide with preexisting methods; remove Cartography<commit_after>//
//  UIViewController+ChildViewControllers.swift
//  PeakFinder
//
//  Created by <NAME> on 4/25/16.
//  Copyright © 2016 Two Ring Software. All rights reserved.
//

import Foundation

extension UIViewController {

    func fillWithChildViewController(childViewController: UIViewController) {
        self.view.addSubview(childViewController.view)

        childViewController.view.translatesAutoresizingMaskIntoConstraints = false
        for constraint in [
            childViewController.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
            childViewController.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
            childViewController.view.topAnchor.constraint(equalTo: self.view.topAnchor),
            childViewController.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor)
            ] {
                constraint.isActive = true
        }


        self.addChildViewController(childViewController)
    }

    /// Call on the instance of the parent view controller to add the child to
    func addNewChildViewController(newChildViewController childViewController: UIViewController) {
        self.view.addSubview(childViewController.view)
        self.addChildViewController(childViewController)
    }

    /// Call on the instance of the child view controller to remove
    func removeAsChildViewController() {
        view.removeFromSuperview()
        removeFromParentViewController()
    }

}
{'fraction_non_alphanumeric': 0.07461538461538461, 'fraction_numerical': 0.006923076923076923, 'mean_word_length': 3.579225352112676, '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': '6034506', 'n_tokens_mistral': 679, 'n_tokens_neox': 610, 'n_words': 134}