<commit_before>//
//  FriendUserCell.swift
//  RoadTripPlanner
//
//  Created by <NAME> on 10/23/17.
//  Copyright © 2017 RoadTripPlanner. All rights reserved.
//

import UIKit
import Parse

class FriendUserCell: UITableViewCell {

    @IBOutlet weak var avatarImageView: UIImageView!
    @IBOutlet weak var usernameLabel: UILabel!
    @IBOutlet weak var addRemoveButton: UIButton!
    
    var avatarFile: PFFile?
    
    var user: PFUser! {
        didSet {
            usernameLabel.text = user.username
            avatarFile = user.avatarFile
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        guard let avatarFile = self.avatarFile else { return }
        Utils.fileToImage(file: avatarFile) { (image) in
            self.avatarImageView.image = image
        }
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    @IBAction func addRemoveButtonPressed(_ sender: Any) {
        
    }
}<commit_msg>Load user avatar file and display it as a circle.<commit_after>//
//  FriendUserCell.swift
//  RoadTripPlanner
//
//  Created by <NAME> on 10/23/17.
//  Copyright © 2017 RoadTripPlanner. All rights reserved.
//

import UIKit
import Parse

class FriendUserCell: UITableViewCell {

    @IBOutlet weak var avatarImageView: UIImageView!
    @IBOutlet weak var usernameLabel: UILabel!
    @IBOutlet weak var addRemoveButton: UIButton!
    
    var user: PFUser! {
        didSet {
            usernameLabel.text = user.username
            guard let avatarFile = user.avatarFile else { return }
            
            Utils.fileToImage(file: avatarFile) { (image) in
                self.avatarImageView.image = image
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        avatarImageView.layer.cornerRadius = avatarImageView.frame.size.height / 2
        avatarImageView.clipsToBounds = true
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    @IBAction func addRemoveButtonPressed(_ sender: Any) {
        
    }
}
{'fraction_non_alphanumeric': 0.08300907911802853, 'fraction_numerical': 0.009079118028534372, 'mean_word_length': 2.2545710267229255, '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': '5378087', 'n_tokens_mistral': 721, 'n_tokens_neox': 662, 'n_words': 181}