<commit_before>//
//  <%= @prefixed_module %>Wireframe.swift
//  <%= @project %>
//
//  Created by <%= @author %> on <%= @date %>.
//
//

import Foundation
import UIKit

class <%= @prefixed_module %>Wireframe: NSObject
{
    weak var rootWireframe: RootWireframe?
    weak var presenter: <%= @prefixed_module %>Presenter?
    weak var viewController: <%= @prefixed_module %>ViewController?

    var parameters: Any?

    func presentSelfFromViewController(viewController: UIViewController)
    {
        // save reference
        self.viewController = <%= @prefixed_module %>ViewController(nibName: "<%= @prefixed_module %>ViewController", bundle: nil)

        // view <-> presenter
        self.presenter?.userInterface = self.viewController
        self.viewController?.eventHandler = self.presenter

        // present controller
        // *** present self with RootViewController
    }

    class func presentFromViewController(_ viewController: UIViewController, _ parameters: Any? = nil) {
        let wireframe = <%= @prefixed_module %>Wireframe()
        let presenter = <%= @prefixed_module %>Presenter()
        let interactor = <%= @prefixed_module %>Interactor()
        let dataManager = <%= @prefixed_module %>DataManager()

        let view = <%= @prefixed_module %>ViewController(nibName: "<%= @prefixed_module %>ViewController", bundle: nil)

        presenter.wireframe = wireframe
        presenter.interactor = interactor
        presenter.userInterface = view

        view.eventHandler = presenter

        wireframe.presenter = presenter
        wireframe.parameters = parameters

        interactor.presenter = presenter
        interactor.dataManager = dataManager

        //  Present View
        if let nav = viewController.navigationController {
            nav.pushViewController(view, animated: true)
        } else {
            viewController.present(view, animated: true, completion: nil)
        }
    }
}<commit_msg>link view to wireframe<commit_after>//
//  <%= @prefixed_module %>Wireframe.swift
//  <%= @project %>
//
//  Created by <%= @author %> on <%= @date %>.
//
//

import Foundation
import UIKit

class <%= @prefixed_module %>Wireframe: NSObject
{
    weak var rootWireframe: RootWireframe?
    weak var presenter: <%= @prefixed_module %>Presenter?
    weak var viewController: <%= @prefixed_module %>ViewController?

    var parameters: Any?

    func presentSelfFromViewController(viewController: UIViewController)
    {
        // save reference
        self.viewController = <%= @prefixed_module %>ViewController(nibName: "<%= @prefixed_module %>ViewController", bundle: nil)

        // view <-> presenter
        self.presenter?.userInterface = self.viewController
        self.viewController?.eventHandler = self.presenter

        // present controller
        // *** present self with RootViewController
    }

    class func presentFromViewController(_ viewController: UIViewController, _ parameters: Any? = nil) {
        let wireframe = <%= @prefixed_module %>Wireframe()
        let presenter = <%= @prefixed_module %>Presenter()
        let interactor = <%= @prefixed_module %>Interactor()
        let dataManager = <%= @prefixed_module %>DataManager()

        let view = <%= @prefixed_module %>ViewController(nibName: "<%= @prefixed_module %>ViewController", bundle: nil)

        presenter.wireframe = wireframe
        presenter.interactor = interactor
        presenter.userInterface = view

        view.eventHandler = presenter

        wireframe.presenter = presenter
        wireframe.viewController = view
        wireframe.parameters = parameters

        interactor.presenter = presenter
        interactor.dataManager = dataManager

        //  Present View
        if let nav = viewController.navigationController {
            nav.pushViewController(view, animated: true)
        } else {
            viewController.present(view, animated: true, completion: nil)
        }
    }
}
{'fraction_non_alphanumeric': 0.11321708364922921, 'fraction_numerical': 0.0, 'mean_word_length': 2.942231075697211, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4144556', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1002, 'n_words': 247}