<commit_before>//
//  ProfileSocialAccountBlogCell.swift
//  Yep
//
//  Created by NIX on 16/5/5.
//  Copyright © 2016年 Catch Inc. All rights reserved.
//

import UIKit

class ProfileSocialAccountBlogCell: UICollectionViewCell {

    @IBOutlet weak var iconImageView: UIImageView!
    @IBOutlet weak var iconImageViewLeadingConstraint: NSLayoutConstraint!

    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var blogLabel: UILabel!

    @IBOutlet weak var accessoryImageView: UIImageView!
    @IBOutlet weak var accessoryImageViewTrailingConstraint: NSLayoutConstraint!

    override func awakeFromNib() {
        super.awakeFromNib()

        accessoryImageView.tintColor = UIColor.yepCellAccessoryImageViewTintColor()
        iconImageViewLeadingConstraint.constant = YepConfig.Profile.leftEdgeInset
        accessoryImageViewTrailingConstraint.constant = YepConfig.Profile.rightEdgeInset

        iconImageView.image = UIImage(named: "icon_blog")
        nameLabel.text = "Blog"
        blogLabel.text = nil

        accessoryImageView.hidden = true
    }

    func configureWithProfileUser(profileUser: ProfileUser?) {

        iconImageView.tintColor = SocialAccount.disabledColor
        nameLabel.textColor = SocialAccount.disabledColor
        blogLabel.textColor = SocialAccount.disabledColor

        if let blogURL = profileUser?.blogURL {

            blogLabel.text = blogURL.absoluteString

            iconImageView.tintColor = UIColor.yepTintColor()
            nameLabel.textColor = UIColor.yepTintColor()

            accessoryImageView.hidden = false
        }
    }
}

<commit_msg>better configure blogURLString in ProfileSocialAccountBlogCell<commit_after>//
//  ProfileSocialAccountBlogCell.swift
//  Yep
//
//  Created by NIX on 16/5/5.
//  Copyright © 2016年 Catch Inc. All rights reserved.
//

import UIKit

class ProfileSocialAccountBlogCell: UICollectionViewCell {

    @IBOutlet weak var iconImageView: UIImageView!
    @IBOutlet weak var iconImageViewLeadingConstraint: NSLayoutConstraint!

    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var blogLabel: UILabel!

    @IBOutlet weak var accessoryImageView: UIImageView!
    @IBOutlet weak var accessoryImageViewTrailingConstraint: NSLayoutConstraint!

    override func awakeFromNib() {
        super.awakeFromNib()

        accessoryImageView.tintColor = UIColor.yepCellAccessoryImageViewTintColor()
        iconImageViewLeadingConstraint.constant = YepConfig.Profile.leftEdgeInset
        accessoryImageViewTrailingConstraint.constant = YepConfig.Profile.rightEdgeInset

        iconImageView.image = UIImage(named: "icon_blog")
        nameLabel.text = "Blog"
        blogLabel.text = nil

        accessoryImageView.hidden = true
    }

    var blogURLString: String? {

        didSet {
            if let blogURLString = blogURLString {

                blogLabel.text = blogURLString

                iconImageView.tintColor = UIColor.yepTintColor()
                nameLabel.textColor = UIColor.yepTintColor()
                blogLabel.textColor = SocialAccount.disabledColor

                accessoryImageView.hidden = false

            } else {
                iconImageView.tintColor = SocialAccount.disabledColor
                nameLabel.textColor = SocialAccount.disabledColor
                blogLabel.textColor = SocialAccount.disabledColor
                
                accessoryImageView.hidden = true
            }
        }
    }

    func configureWithProfileUser(profileUser: ProfileUser?) {

        if profileUser?.isMe ?? false {
            blogURLString = YepUserDefaults.blogURLString.value
        } else {
            blogURLString = profileUser?.blogURL?.absoluteString
        }
    }
}


{'fraction_non_alphanumeric': 0.06866952789699571, 'fraction_numerical': 0.004291845493562232, 'mean_word_length': 2.7896341463414633, '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': '4231597', 'n_tokens_mistral': 1077, 'n_tokens_neox': 987, 'n_words': 203}