<commit_before>//
//  CreateAccountViewController.swift
//  VolunteerMe
//
//  Created by ruthie_berman on 10/14/17.
//  Copyright © 2017 volunteer_me. All rights reserved.
//

import UIKit

class CreateAccountViewController: UIViewController {
    
    @IBOutlet weak var titleText: UILabel!
    @IBOutlet weak var subtitleText: UILabel!
    @IBOutlet weak var usernameField: UITextField!
    @IBOutlet weak var passwordField: UITextField!
    @IBOutlet weak var usernameUnderline: UIView!
    @IBOutlet weak var passwordUnderline: UIView!
    @IBOutlet weak var createAccountButtonBackground: UIView!
    @IBOutlet weak var createAccountButtonLabel: UILabel!
    @IBOutlet weak var tagsView: UIView!

    @IBOutlet weak var animalsTag: UILabel!
    @IBOutlet weak var discriminationTag: UILabel!
    @IBOutlet weak var educationTag: UILabel!
    @IBOutlet weak var elderlyTag: UILabel!
    @IBOutlet weak var environmentTag: UILabel!
    @IBOutlet weak var healthTag: UILabel!
    @IBOutlet weak var homelessnessTag: UILabel!
    @IBOutlet weak var hungerTag: UILabel!
    @IBOutlet weak var youthTag: UILabel!

    
    var tagLabels: [UILabel] = [UILabel]()

    override func viewDidLoad() {
        super.viewDidLoad()
        titleText.textColor = Color.PRIMARY_COLOR
        subtitleText.textColor = Color.PRIMARY_COLOR
        usernameUnderline.backgroundColor = Color.PRIMARY_COLOR
        passwordUnderline.backgroundColor = Color.PRIMARY_COLOR
        
        createAccountButtonBackground.backgroundColor = Color.PRIMARY_COLOR
        createAccountButtonBackground.layer.cornerRadius = 8.0
        createAccountButtonBackground.clipsToBounds = true
        createAccountButtonLabel.textColor = Color.WHITE

        tagLabels = [
          animalsTag,
          discriminationTag,
          educationTag,
          elderlyTag,
          environmentTag,
          healthTag,
          homelessnessTag,
          hungerTag,
          youthTag,
        ]

        var i = 0
        for tag in tagLabels {
          tag.tag = i
          tag.backgroundColor = Color.PRIMARY_COLOR
          tag.textColor = Color.WHITE
          tag.text = " " + tag.text! + " "
          tag.layer.cornerRadius = 8.0
          tag.clipsToBounds = true
//          let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.tagTapped(_:)))
//          tag.addGestureRecognizer(tapGesture)
          i += 1
        }
        
        // Do any additional setup after loading the view.
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func tagTapped(gestureRecognizer: UITapGestureRecognizer) {
      print("TAPPED")
      let tag = tagLabels[gestureRecognizer.view!.tag]
      if tag.backgroundColor == Color.PRIMARY_COLOR {
        tag.backgroundColor = Color.SECONDARY_COLOR
      } else {
        tag.backgroundColor = Color.PRIMARY_COLOR
      }
      // Mark tag as selected
    }<commit_msg>can tap tags in create account<commit_after>//
//  CreateAccountViewController.swift
//  VolunteerMe
//
//  Created by ruthie_berman on 10/14/17.
//  Copyright © 2017 volunteer_me. All rights reserved.
//

import UIKit

class CreateAccountViewController: UIViewController {
    
    @IBOutlet weak var titleText: UILabel!
    @IBOutlet weak var subtitleText: UILabel!
    @IBOutlet weak var usernameField: UITextField!
    @IBOutlet weak var passwordField: UITextField!
    @IBOutlet weak var usernameUnderline: UIView!
    @IBOutlet weak var passwordUnderline: UIView!
    @IBOutlet weak var createAccountButtonBackground: UIView!
    @IBOutlet weak var createAccountButtonLabel: UILabel!
    @IBOutlet weak var tagsView: UIView!

    @IBOutlet weak var animalsTag: UILabel!
    @IBOutlet weak var discriminationTag: UILabel!
    @IBOutlet weak var educationTag: UILabel!
    @IBOutlet weak var elderlyTag: UILabel!
    @IBOutlet weak var environmentTag: UILabel!
    @IBOutlet weak var healthTag: UILabel!
    @IBOutlet weak var homelessnessTag: UILabel!
    @IBOutlet weak var hungerTag: UILabel!
    @IBOutlet weak var youthTag: UILabel!

    
    var tagLabels: [UILabel] = [UILabel]()

    override func viewDidLoad() {
        super.viewDidLoad()
        titleText.textColor = Color.PRIMARY_COLOR
        subtitleText.textColor = Color.PRIMARY_COLOR
        usernameUnderline.backgroundColor = Color.PRIMARY_COLOR
        passwordUnderline.backgroundColor = Color.PRIMARY_COLOR
        
        createAccountButtonBackground.backgroundColor = Color.PRIMARY_COLOR
        createAccountButtonBackground.layer.cornerRadius = 8.0
        createAccountButtonBackground.clipsToBounds = true
        createAccountButtonLabel.textColor = Color.WHITE

        tagLabels = [
          animalsTag,
          discriminationTag,
          educationTag,
          elderlyTag,
          environmentTag,
          healthTag,
          homelessnessTag,
          hungerTag,
          youthTag,
        ]

        var i = 0
        for tag in tagLabels {
          tag.tag = i
          tag.backgroundColor = Color.PRIMARY_COLOR
          tag.textColor = Color.WHITE
          tag.text = " " + tag.text! + " "
          tag.layer.cornerRadius = 8.0
          tag.clipsToBounds = true
          tag.isUserInteractionEnabled = true
          let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tagTapped(gestureRecognizer:)))
          tag.addGestureRecognizer(tapGesture)
          i += 1
        }
        
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func tagTapped(gestureRecognizer: UITapGestureRecognizer) {
      let tag = tagLabels[gestureRecognizer.view!.tag]
      if tag.backgroundColor == Color.PRIMARY_COLOR {
        tag.backgroundColor = Color.SECONDARY_COLOR
      } else {
        tag.backgroundColor = Color.PRIMARY_COLOR
      }
      // Mark tag as selected
    }
{'fraction_non_alphanumeric': 0.07241379310344828, 'fraction_numerical': 0.005254515599343186, 'mean_word_length': 2.58716136631331, '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': '11442', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1737, 'n_words': 428}