<commit_before>//
//  PagedScrollViewController.swift
//  ScrollViews
//
//  Created by Domenico on 06/06/15.
//  Copyright (c) 2015 Domenico. All rights reserved.
//

import UIKit

class PagedScrollViewController: UIViewController, UIScrollViewDelegate {
    @IBOutlet var scrollView: UIScrollView!
    @IBOutlet var pageControl: UIPageControl!
    // It will hold all the images to display. 1 for page
    var pageImages: [UIImage] = []
    // It will hold instances of UIImageView to display each image on its respective page
    var pageViews: [UIImageView?] = []
}<commit_msg>Initialisation of the view<commit_after>//
//  PagedScrollViewController.swift
//  ScrollViews
//
//  Created by Domenico on 06/06/15.
//  Copyright (c) 2015 Domenico. All rights reserved.
//

import UIKit

class PagedScrollViewController: UIViewController, UIScrollViewDelegate {
    @IBOutlet var scrollView: UIScrollView!
    @IBOutlet var pageControl: UIPageControl!
    // It will hold all the images to display. 1 for page
    var pageImages: [UIImage] = []
    // It will hold instances of UIImageView to display each image on its respective page
    var pageViews: [UIImageView?] = []
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // set up the page images
        pageImages = [UIImage(named: "photo1.png")!,
            UIImage(named: "photo2.png")!,
            UIImage(named: "photo3.png")!,
            UIImage(named: "photo4.png")!,
            UIImage(named: "photo5.png")!]
        
        let pageCount = pageImages.count
        
        // set the page control to the first page and tell it how many pages there are.
        pageControl.currentPage = 0
        pageControl.numberOfPages = pageCount
        
        // Set up the array that holds the UIImageView instances. At first, no pages have been lazily loaded and so you just fill it with nil objects as placeholders – one for each page
        for _ in 0..<pageCount {
            pageViews.append(nil)
        }
        
        // The scroll view, as before, needs to know its content size. Since you want a horizontal paging scroll view (it could just as easily be vertical if you want), you calculate the width to be the number of pages multiplied by the width of the scroll view. The height of the content is the same as the height of the scroll view.
        let pagesScrollViewSize = scrollView.frame.size
        scrollView.contentSize = CGSize(width: pagesScrollViewSize.width * CGFloat(pageImages.count),
            height: pagesScrollViewSize.height)
        
        // need some pages shown initially
    }
}
{'fraction_non_alphanumeric': 0.07903780068728522, 'fraction_numerical': 0.011072928598701794, 'mean_word_length': 2.6541143654114365, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1892401', 'n_tokens_mistral': 757, 'n_tokens_neox': 719, 'n_words': 279}