<commit_before>import UIKit
import DeclarativeLayout

class RegistrationExampleWithFrameworkViewController: UIViewController {
    
    private lazy var viewLayout = ViewLayout(view: view)
    private let registerOrSignInSegmentedControl = UISegmentedControl()
    private let headerLabel = UILabel()
    private let stackView = UIStackView()
    private let emailContainerView = UIView()
    private let emailLabel = UILabel()
    private let emailTextField = UITextField()
    private let passwordContainerView = UIView()
    private let passwordLabel = UILabel()
    private let passwordTextField = UITextField()
    private let submitButton = UIButton()
    private let forgotMyPasswordButton = UIButton()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "With Framework"
        
        layoutAllViews()
        configureAllViews()
    }
    
    private func layoutAllViews() {
        
        viewLayout.updateLayoutTo { (component) in
            
            component.addView(self.registerOrSignInSegmentedControl) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: component.superview.topAnchor, constant: 84),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor, constant: 20),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor, constant: -20),
                ])
            }
            
            component.addView(self.headerLabel) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: self.registerOrSignInSegmentedControl.bottomAnchor, constant: 30),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor, constant: 20),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor, constant: -20),
                ])
            }
            
            component.addStackView(stackView) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: self.headerLabel.bottomAnchor),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor),
                ])
                
                component.addArrangedView(self.emailContainerView) { (component) in<commit_msg>Fix example so that all subviews are accessed using self<commit_after>import UIKit
import DeclarativeLayout

class RegistrationExampleWithFrameworkViewController: UIViewController {
    
    private lazy var viewLayout = ViewLayout(view: view)
    private let registerOrSignInSegmentedControl = UISegmentedControl()
    private let headerLabel = UILabel()
    private let stackView = UIStackView()
    private let emailContainerView = UIView()
    private let emailLabel = UILabel()
    private let emailTextField = UITextField()
    private let passwordContainerView = UIView()
    private let passwordLabel = UILabel()
    private let passwordTextField = UITextField()
    private let submitButton = UIButton()
    private let forgotMyPasswordButton = UIButton()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "With Framework"
        
        layoutAllViews()
        configureAllViews()
    }
    
    private func layoutAllViews() {
        
        viewLayout.updateLayoutTo { (component) in
            
            component.addView(self.registerOrSignInSegmentedControl) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: component.superview.topAnchor, constant: 84),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor, constant: 20),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor, constant: -20),
                ])
            }
            
            component.addView(self.headerLabel) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: self.registerOrSignInSegmentedControl.bottomAnchor, constant: 30),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor, constant: 20),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor, constant: -20),
                ])
            }
            
            component.addStackView(self.stackView) { (component) in
                
                component.activate([
                    component.view.topAnchor.constraint(equalTo: self.headerLabel.bottomAnchor),
                    component.view.leadingAnchor.constraint(equalTo: component.superview.leadingAnchor),
                    component.view.trailingAnchor.constraint(equalTo: component.superview.trailingAnchor),
                ])
                
                component.addArrangedView(self.emailContainerView) { (component) in
{'fraction_non_alphanumeric': 0.07618510158013544, 'fraction_numerical': 0.004514672686230248, 'mean_word_length': 2.284126003705991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3319028', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1218, 'n_words': 242}