<commit_before>//
//  ViewController.swift
//  图片浏览工具
//
//  Created by 沈和平 on 16/8/29.
//  Copyright © 2016年 SHP. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let scroll = UIScrollView(frame: CGRectMake(80, 80, 100, 60))
        scroll.backgroundColor = UIColor.purpleColor()
        scroll.contentSize = CGSizeMake(100 * 2, 0)
        scroll.pagingEnabled = true
        view.addSubview(scroll)
        
        let v1 = UIView(frame: CGRectMake(0, 0, 120, 60))
        v1.backgroundColor = UIColor.orangeColor()
        scroll.addSubview(v1)
        
        let btn = UIButton(type: UIButtonType.Custom)
        btn.frame = CGRectMake(0, 0, 100, 30)
        btn.setTitle("进入图片", forState: UIControlState.Normal)
        btn.center = view.center
        btn.backgroundColor = UIColor.orangeColor()
        btn.addTarget(self, action: #selector(ViewController.click(_:)), forControlEvents: UIControlEvents.TouchUpInside)
        view.addSubview(btn)
    }
    
    @objc private func click(sender:UIButton) {
        
        var loadArray = [HPPictureBrowsingModel]()

/*
        // 加载本地image
        for var i:Int in 0..<7 {
            
            i += 1
            
            let imge = UIImage(named: String(i))
            
            let model = HPPictureBrowsingModel()
            model.loadImage = imge
            model.placeholdImage = UIImage(named: "placeholdImage")
            
            loadArray.append(model)
        }
        
*/
        
        // 加载网络图片
        let loadImageUrlArray = [
            "http://www.bz55.com/uploads/allimg/150414/140-150414102U7.jpg",
            "http://www.bz55.com/uploads/allimg/150708/140-150FQ42011.jpg",
            "http://cache.365jia.com/uploads/10/0927/4ca0469778c38.jpg",
            "http://www.bz55.com/uploads/allimg/150719/139-150G9151227.jpg",
            "http://a.ikafan.com/attachment/forum/201304/06/223247ha510huf5g09f7o5.jpg",
            "http://img1.tgbusdata.cn/thumbnail/jpg/MmMyYyw5NjAsMjAwLDQsMSwxLC0xLDEsMSxyazUw/u/pc.tgbus.com/uploads/allimg/140111/5-140111105518.jpg",
            "http://www.bz55.com/uploads/allimg/150410/139-150410101U6.jpg",
            "http://att.bbs.duowan.com/forum/201503/18/205608ulef6m5uzmrl5uf7.jpg",
            "http://imgsrc.baidu.com/forum/pic/item/4423008d3fea8f6499502724.jpg"
        ]
        
        for i:Int in 0..<loadImageUrlArray.count {
            
            let imgeUrl = loadImageUrlArray[i]
            
            let model = HPPictureBrowsingModel()
            model.loadImageUrl = imgeUrl
            
            // 可设置占位图片
//            model.placeholdImage = UIImage(named: "placeholdImage")
            
            loadArray.append(model)
        }
        
        let pictureBrowsingView = HPPictureBrowsingView(frame: CGRectMake(20, 70, 200, 400), dataSource: loadArray, currentNumber: 6, localCache:true)
        pictureBrowsingView.backgroundColor = UIColor.whiteColor()
        view.addSubview(pictureBrowsingView)
        
    }
    
}

<commit_msg>1.适配 2.删除无关控件<commit_after>//
//  ViewController.swift
//  图片浏览工具
//
//  Created by 沈和平 on 16/8/29.
//  Copyright © 2016年 SHP. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let btn = UIButton(type: UIButtonType.Custom)
        btn.frame = CGRectMake(0, 0, 100, 30)
        btn.setTitle("进入图片", forState: UIControlState.Normal)
        btn.center = view.center
        btn.backgroundColor = UIColor.orangeColor()
        btn.addTarget(self, action: #selector(ViewController.click(_:)), forControlEvents: UIControlEvents.TouchUpInside)
        view.addSubview(btn)
    }
    
    @objc private func click(sender:UIButton) {
        
        var loadArray = [HPPictureBrowsingModel]()

/*
        // 加载本地image
        for var i:Int in 0..<7 {
            
            i += 1
            
            let imge = UIImage(named: String(i))
            
            let model = HPPictureBrowsingModel()
            model.loadImage = imge
            model.placeholdImage = UIImage(named: "placeholdImage")
            
            loadArray.append(model)
        }
        
*/
        
        // 加载网络图片
        let loadImageUrlArray = [
            "http://www.bz55.com/uploads/allimg/150414/140-150414102U7.jpg",
            "http://www.bz55.com/uploads/allimg/150708/140-150FQ42011.jpg",
            "http://cache.365jia.com/uploads/10/0927/4ca0469778c38.jpg",
            "http://www.bz55.com/uploads/allimg/150719/139-150G9151227.jpg",
            "http://a.ikafan.com/attachment/forum/201304/06/223247ha510huf5g09f7o5.jpg",
            "http://img1.tgbusdata.cn/thumbnail/jpg/MmMyYyw5NjAsMjAwLDQsMSwxLC0xLDEsMSxyazUw/u/pc.tgbus.com/uploads/allimg/140111/5-140111105518.jpg",
            "http://www.bz55.com/uploads/allimg/150410/139-150410101U6.jpg",
            "http://att.bbs.duowan.com/forum/201503/18/205608ulef6m5uzmrl5uf7.jpg",
            "http://imgsrc.baidu.com/forum/pic/item/4423008d3fea8f6499502724.jpg"
        ]
        
        for i:Int in 0..<loadImageUrlArray.count {
            
            let imgeUrl = loadImageUrlArray[i]
            
            let model = HPPictureBrowsingModel()
            model.loadImageUrl = imgeUrl
            
            // 可设置占位图片
//            model.placeholdImage = UIImage(named: "placeholdImage")
            
            loadArray.append(model)
        }
        
        let pictureBrowsingView = HPPictureBrowsingView(frame: CGRectMake(0, 20, UIScreen.mainScreen().bounds.width, 400), dataSource: loadArray, currentNumber: 6, localCache:true)
        pictureBrowsingView.backgroundColor = UIColor.whiteColor()
        view.addSubview(pictureBrowsingView)
        
    }
    
}


{'fraction_non_alphanumeric': 0.11463994565217392, 'fraction_numerical': 0.07608695652173914, 'mean_word_length': 1.9652567975830815, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '4624916', 'n_tokens_mistral': 2315, 'n_tokens_neox': 2041, 'n_words': 263}