<commit_before>//
//  ViewController.swift
//  CATransform3DDemo
//
//  Created by zz on 2017/8/28.
//  Copyright © 2017年 zzkj. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

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


}
<commit_msg>CATranform3DDemo<commit_after>//
//  ViewController.swift
//  CATransform3DDemo
//
//  Created by zz on 2017/8/28.
//  Copyright © 2017年 zzkj. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

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

    let delegate = LayerDelegate()
    
    lazy var sublayer: CALayer = {
        let layer = CALayer()
        layer.delegate = self.delegate
        
        return layer
    }()
    
    func moveSublayer() {
        guard let action = sublayer.action(forKey: "moveRight") else {
            return
        }
        
        action.run(forKey: "transform", object: sublayer, arguments: nil)
    }
    
    class LayerDelegate: NSObject, CALayerDelegate {
        func action(for layer: CALayer, forKey event: String) -> CAAction? {
            
            guard event == "moveRight" else {
                return nil
            }
            
            let animation = CABasicAnimation()
            animation.valueFunction = CAValueFunction(name: kCAValueFunctionTranslateX)
            animation.fromValue = 1
            animation.toValue = 300
            animation.duration = 2
            
            return animation
        }
    }
}

{'fraction_non_alphanumeric': 0.08383233532934131, 'fraction_numerical': 0.014970059880239521, 'mean_word_length': 1.9572271386430677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2010539', 'n_tokens_mistral': 594, 'n_tokens_neox': 537, 'n_words': 157}