<commit_before>//
//  InputControlViewController.swift
//  Remocon
//
//  Created by <NAME> on 2015/05/30.
//  Copyright (c) 2015年 <NAME>. All rights reserved.
//

import UIKit

class InputControlViewController: UIViewController {
    lazy fileprivate var inputControlView: InputControlView = self.createInputControlView()
    lazy fileprivate var signal: IremoconSignal = self.createIremoconSignal()
    private var isHiddenHomeIndicator: Bool = true

    // MARK: - Life cycle events -
    override func viewDidLoad() {
        super.viewDidLoad()
        self.initBackground()
        self.view.addSubview(inputControlView)
        if #available(iOS 11, *) { setNeedsUpdateOfHomeIndicatorAutoHidden()  }
    }

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        self.initNavigation()
        self.layoutChannelContainerView()
        self.inputControlView.delegate = self
    }

    // MARK: - Create subviews -
    fileprivate func createInputControlView() -> InputControlView {
        return InputControlView(frame: CGRect.zero)
    }

    fileprivate func initBackground() {
        self.view.backgroundColor = .clear
        let visuaEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
        visuaEffectView.frame = self.view.bounds
        visuaEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        visuaEffectView.translatesAutoresizingMaskIntoConstraints = true
        self.view.addSubview(visuaEffectView)
    }

    // MARK: - Layout subviews -
    fileprivate func layoutChannelContainerView() {
        inputControlView.frame.size = CGSize(width: 360, height: 480)
        inputControlView.center = self.view.center
    }

    fileprivate func createIremoconSignal() -> IremoconSignal {
        return IremoconSignal.sharedInstance
    }

    fileprivate func initNavigation() {
        let doneButton: UIBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(InputControlViewController.pushedDoneButton(_:)))
        doneButton.tintColor = UIColor.white
        self.navigationItem.rightBarButtonItem = doneButton

        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
        self.navigationController?.navigationBar.shadowImage = UIImage()
        self.navigationController?.navigationBar.isTranslucent = true
    }

    @objc internal func pushedDoneButton(_ sender: UIButton) {
        self.dismiss(animated: true, completion: nil)
    }

    @available(iOS 11, *)
    override var prefersHomeIndicatorAutoHidden: Bool {
        return isHiddenHomeIndicator
    }
}

extension InputControlViewController: InputControlViewDelegate {
    func buttonDidTap(_ channel: Int, sender: InputControlView) {
        signal.send(channel)
    }
}
<commit_msg>Show HomeIndicator<commit_after>//
//  InputControlViewController.swift
//  Remocon
//
//  Created by <NAME> on 2015/05/30.
//  Copyright (c) 2015年 <NAME>. All rights reserved.
//

import UIKit

class InputControlViewController: UIViewController {
    lazy fileprivate var inputControlView: InputControlView = self.createInputControlView()
    lazy fileprivate var signal: IremoconSignal = self.createIremoconSignal()
    private var isHiddenHomeIndicator: Bool = true

    // MARK: - Life cycle events -
    override func viewDidLoad() {
        super.viewDidLoad()
        self.initBackground()
        self.view.addSubview(inputControlView)
    }

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        self.initNavigation()
        self.layoutChannelContainerView()
        self.inputControlView.delegate = self
    }

    // MARK: - Create subviews -
    fileprivate func createInputControlView() -> InputControlView {
        return InputControlView(frame: CGRect.zero)
    }

    fileprivate func initBackground() {
        self.view.backgroundColor = .clear
        let visuaEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
        visuaEffectView.frame = self.view.bounds
        visuaEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        visuaEffectView.translatesAutoresizingMaskIntoConstraints = true
        self.view.addSubview(visuaEffectView)
    }

    // MARK: - Layout subviews -
    fileprivate func layoutChannelContainerView() {
        inputControlView.frame.size = CGSize(width: 360, height: 480)
        inputControlView.center = self.view.center
    }

    fileprivate func createIremoconSignal() -> IremoconSignal {
        return IremoconSignal.sharedInstance
    }

    fileprivate func initNavigation() {
        let doneButton: UIBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(InputControlViewController.pushedDoneButton(_:)))
        doneButton.tintColor = UIColor.white
        self.navigationItem.rightBarButtonItem = doneButton

        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
        self.navigationController?.navigationBar.shadowImage = UIImage()
        self.navigationController?.navigationBar.isTranslucent = true
    }

    @objc internal func pushedDoneButton(_ sender: UIButton) {
        self.dismiss(animated: true, completion: nil)
    }

    @available(iOS 11, *)
    override var prefersHomeIndicatorAutoHidden: Bool {
        return isHiddenHomeIndicator
    }
}

extension InputControlViewController: InputControlViewDelegate {
    func buttonDidTap(_ channel: Int, sender: InputControlView) {
        signal.send(channel)
    }
}

{'fraction_non_alphanumeric': 0.08849398671692695, 'fraction_numerical': 0.007539041464728056, 'mean_word_length': 3.366771159874608, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5094470', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1503, 'n_words': 315}