<commit_before><commit_msg>Initial Segmaneted Control Implementation<commit_after>//
//  TwicketSegmentedControl.swift
//  Twicket
//
//  Created by <NAME> on 7/11/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import UIKit

class TwicketSegmentedControl: UIView {
    static let height: CGFloat = 44
    var selectedIndex = 0 {
        didSet {
            segmentedControl.selectedSegmentIndex = selectedIndex
        }
    }
    
    lazy var segmentedControl: UISegmentedControl = { [unowned self] in
        let control = UISegmentedControl(items: ["Tweets", "Users"])
        control.frameWidth = self.frameWidth - Margin.m20
        control.centerX = self.frameWidth/2
        control.centerY = TwicketSegmentedControl.height/2
        control.tintColor = UIColor.whiteColor()
        return control
        }()
    
    init(width: CGFloat, initialIndex: Int = 0) {
        super.init(frame: CGRect(x: 0, y: 0, width: width, height: TwicketSegmentedControl.height))
        addSubview(segmentedControl)
        backgroundColor = Color.mainBlueBackgroundColor
        selectedIndex = initialIndex
        segmentedControl.selectedSegmentIndex = selectedIndex
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
{'fraction_non_alphanumeric': 0.09377401998462721, 'fraction_numerical': 0.014604150653343582, 'mean_word_length': 2.8181818181818183, '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': '639608', 'n_tokens_mistral': 393, 'n_tokens_neox': 374, 'n_words': 87}