<commit_before>//
//  ViewController.swift
//  SJRefresh
//
//  Created by <NAME> on 10/04/2016.
//  Copyright (c) 2016 <NAME>. All rights reserved.
//

import UIKit
import SJRefresh

class ViewController: UIViewController {

	@IBOutlet weak var tableView: UITableView!

	override func viewDidLoad() {
		super.viewDidLoad()

		let options = RefreshViewOptions()
		options.pullImage = "pulltorefresharrow"
		options.gifImage = "Loader"
		options.definite = true

		tableView.addRefreshView(options: options) { _ in

			if options.definite == true {

				self.tableView.setRefreshPrecentage(60)
				self.perform(#selector(self.animate),
				             with: nil,
				             afterDelay: 2.0)
			} else {

				sleep(2)
				self.tableView.stopPullRefresh()
			}
		}
	}

	func animate() {

		tableView.setRefreshPrecentage(100)
	}
}

extension ViewController: UITableViewDataSource {

	func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

		return 20
	}

	func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

		let cell = tableView.dequeueReusableCell(withIdentifier: "CellIdentifier")
		cell?.textLabel?.text = String(indexPath.row)
		return cell!
	}
}<commit_msg>Updated example<commit_after>//
//  ViewController.swift
//  SJRefresh
//
//  Created by <NAME> on 10/04/2016.
//  Copyright (c) 2016 <NAME>. All rights reserved.
//

import UIKit
import SJRefresh

class ViewController: UIViewController {

	@IBOutlet weak var tableView: UITableView!

	override func viewDidLoad() {
		super.viewDidLoad()

		let options = RefreshViewOptions()
		options.pullImage = "pulltorefresharrow"
		options.gifImage = "Loader"
		options.definite = true

		tableView.addRefreshView(options: options) { _ in

			if options.definite == true {

				//definite animation
				self.tableView.setRefreshPrecentage(60)
				self.perform(#selector(self.animate(_:)),
				             with: 80.0,
				             afterDelay: 2.0)
				self.perform(#selector(self.animate(_:)),
				             with: 100.0,
				             afterDelay: 3.0)
			} else {

				// Indefinite animation
				sleep(2)
				self.tableView.stopPullRefresh()
			}
		}
	}

	func animate(_ percentage: NSNumber) {

		tableView.setRefreshPrecentage(CGFloat(percentage.floatValue))
	}
}

extension ViewController: UITableViewDataSource {

	func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

		return 20
	}

	func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

		let cell = tableView.dequeueReusableCell(withIdentifier: "CellIdentifier")
		cell?.textLabel?.text = String(indexPath.row)
		return cell!
	}
}
{'fraction_non_alphanumeric': 0.10918480265584656, 'fraction_numerical': 0.018443378827001106, 'mean_word_length': 3.416938110749186, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4026095', 'n_tokens_mistral': 1033, 'n_tokens_neox': 831, 'n_words': 186}