<commit_before>import UIKit
import FBSDKShareKit

class VSettingsCellFacebookShare:VSettingsCell
{
    private let kStringUrl:String = "https://www.facebook.com/FacebookDevelopers"
    
    override init(frame:CGRect)
    {
        super.init(frame:frame)
        
        guard
            
            let url:URL = URL(string:kStringUrl)
        
        else
        {
            return
        }
        
        let fbContent:FBSDKShareLinkContent = FBSDKShareLinkContent()
        fbContent.contentURL = url
        
        let fbButton:FBSDKShareButton = FBSDKShareButton()
        fbButton.shareContent = fbContent
        fbButton.center = center
        
        addSubview(fbButton)
    }
    
    required init?(coder:NSCoder)
    {
        fatalError()
    }
}<commit_msg>constraints for fb button<commit_after>import UIKit
import FBSDKShareKit

class VSettingsCellFacebookShare:VSettingsCell
{
    private weak var fbButton:FBSDKShareButton!
    private weak var layoutFbButtonLeft:NSLayoutConstraint!
    private let kFbButtonTop:CGFloat = 10
    private let kStringUrl:String = "https://www.facebook.com/FacebookDevelopers"
    
    override init(frame:CGRect)
    {
        super.init(frame:frame)
        
        guard
            
            let url:URL = URL(string:kStringUrl)
        
        else
        {
            return
        }
        
        let fbContent:FBSDKShareLinkContent = FBSDKShareLinkContent()
        fbContent.contentURL = url
        
        let fbButton:FBSDKShareButton = FBSDKShareButton()
        fbButton.shareContent = fbContent
        fbButton.translatesAutoresizingMaskIntoConstraints = false
        self.fbButton = fbButton
        
        addSubview(fbButton)
        
        let views:[String:UIView] = [
            "fbButton":fbButton]
        
        let metrics:[String:CGFloat] = [
            "fbButtonTop":kFbButtonTop]
        
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(fbButtonTop)-[fbButton]",
            options:[],
            metrics:metrics,
            views:views))
        
        layoutFbButtonLeft = NSLayoutConstraint(
            item:fbButton,
            attribute:NSLayoutAttribute.left,
            relatedBy:NSLayoutRelation.equal,
            toItem:self,
            attribute:NSLayoutAttribute.left,
            multiplier:1,
            constant:0)
        
        addConstraint(layoutFbButtonLeft)
    }
    
    required init?(coder:NSCoder)
    {
        fatalError()
    }
    
    override func layoutSubviews()
    {
        let width:CGFloat = bounds.maxX
        let buttonWidth:CGFloat = fbButton.bounds.maxX
        let remain:CGFloat = width - buttonWidth
        let margin:CGFloat = remain / 2.0
        layoutFbButtonLeft.constant = margin
        
        super.layoutSubviews()
    }
}
{'fraction_non_alphanumeric': 0.0729568572430726, 'fraction_numerical': 0.002104524728165556, 'mean_word_length': 1.925128205128205, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '932652', 'n_tokens_mistral': 826, 'n_tokens_neox': 787, 'n_words': 128}