<commit_before>import UIKit
import DeclarativeLayout

// MARK: - Layout extensions

private extension UIViewLayoutComponent {
    func layout(closure: (T) -> [NSLayoutConstraint]) {
        activate(closure(view))
    }
}

private extension UIViewSubviewLayoutComponent {
    func layout(closure: (T, R) -> [NSLayoutConstraint]) {
        activate(closure(view, superview))
    }
}

private extension UIStackViewSubviewLayoutComponent {
    func layout(closure: (T, R) -> [NSLayoutConstraint]) {
        activate(closure(view, superview))
    }
}

private extension UILayoutGuideComponent {
    func layout(closure: (R) -> [NSLayoutConstraint]) {
        activate(closure(owningView))
    }
}

class MenuViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
    
    enum Row {
        case readme
        case registrationWithoutFramework
        case registrationWithFramework
        case registrationWithFrameworkAndAnchorage
        case registrationWithFrameworkAndSnapkit
        
        static var allRows: [Row] {
            return [
                .readme,
                .registrationWithoutFramework,
                .registrationWithFramework,
                .registrationWithFrameworkAndAnchorage,
                .registrationWithFrameworkAndSnapkit,
            ]
        }
    }
    
    private let tableView = UITableView()
    private lazy var viewLayout = ViewLayout(view: view)
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "Menu"
        
        layoutAllViews()
        configureAllViews()
    }
    
    private func layoutAllViews() {
        viewLayout.updateLayoutTo { (component) in
            component.addView(tableView) { (component) in
                component.layout {[
                    $0.topAnchor.constraint(equalTo: $1.topAnchor),
                    $0.leadingAnchor.constraint(equalTo: $1.leadingAnchor),
                    $0.trailingAnchor.constraint(equalTo: $1.trailingAnchor),
                    $0.bottomAnchor.constraint(equalTo: $1.bottomAnchor),
                ]}
            }
        }
    }
    
    // Don't worry about this below here
    
    private func configureAllViews() {
        view.backgroundColor = .white
        
        tableView.rowHeight = UITableView.automaticDimension
        tableView.delegate = self
        tableView.dataSource = self
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return Row.allRows.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
        cell.textLabel?.numberOfLines = 0
        cell.textLabel?.lineBreakMode = .byWordWrapping
        
        switch Row.allRows[indexPath.row] {
        case .readme:
            cell.textLabel?.text = "Quick Start Example"
        case .registrationWithoutFramework:
            cell.textLabel?.text = "Registration Screen Without Framework"
        case .registrationWithFramework:
            cell.textLabel?.text = "Registration Screen With Framework"
        case .registrationWithFrameworkAndAnchorage:
            cell.textLabel?.text = "Registration Screen With Framework and Anchorage"
        case .registrationWithFrameworkAndSnapkit:<commit_msg>Fix text in example menu<commit_after>import UIKit
import DeclarativeLayout

// MARK: - Layout extensions

private extension UIViewLayoutComponent {
    func layout(closure: (T) -> [NSLayoutConstraint]) {
        activate(closure(view))
    }
}

private extension UIViewSubviewLayoutComponent {
    func layout(closure: (T, R) -> [NSLayoutConstraint]) {
        activate(closure(view, superview))
    }
}

private extension UIStackViewSubviewLayoutComponent {
    func layout(closure: (T, R) -> [NSLayoutConstraint]) {
        activate(closure(view, superview))
    }
}

private extension UILayoutGuideComponent {
    func layout(closure: (R) -> [NSLayoutConstraint]) {
        activate(closure(owningView))
    }
}

class MenuViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
    
    enum Row {
        case readme
        case registrationWithoutFramework
        case registrationWithFramework
        case registrationWithFrameworkAndAnchorage
        case registrationWithFrameworkAndSnapkit
        
        static var allRows: [Row] {
            return [
                .readme,
                .registrationWithoutFramework,
                .registrationWithFramework,
                .registrationWithFrameworkAndAnchorage,
                .registrationWithFrameworkAndSnapkit,
            ]
        }
    }
    
    private let tableView = UITableView()
    private lazy var viewLayout = ViewLayout(view: view)
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "Menu"
        
        layoutAllViews()
        configureAllViews()
    }
    
    private func layoutAllViews() {
        viewLayout.updateLayoutTo { (component) in
            component.addView(tableView) { (component) in
                component.layout {[
                    $0.topAnchor.constraint(equalTo: $1.topAnchor),
                    $0.leadingAnchor.constraint(equalTo: $1.leadingAnchor),
                    $0.trailingAnchor.constraint(equalTo: $1.trailingAnchor),
                    $0.bottomAnchor.constraint(equalTo: $1.bottomAnchor),
                ]}
            }
        }
    }
    
    // Don't worry about this below here
    
    private func configureAllViews() {
        view.backgroundColor = .white
        
        tableView.rowHeight = UITableView.automaticDimension
        tableView.delegate = self
        tableView.dataSource = self
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return Row.allRows.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
        cell.textLabel?.numberOfLines = 0
        cell.textLabel?.lineBreakMode = .byWordWrapping
        
        switch Row.allRows[indexPath.row] {
        case .readme:
            cell.textLabel?.text = "README Example"
        case .registrationWithoutFramework:
            cell.textLabel?.text = "Registration Screen Without Framework"
        case .registrationWithFramework:
            cell.textLabel?.text = "Registration Screen With Framework"
        case .registrationWithFrameworkAndAnchorage:
            cell.textLabel?.text = "Registration Screen With Framework and Anchorage"
        case .registrationWithFrameworkAndSnapkit:
{'fraction_non_alphanumeric': 0.07991742848717193, 'fraction_numerical': 0.0026540843409023885, 'mean_word_length': 2.2863372093023258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2006822', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1698, 'n_words': 370}