-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.swift
More file actions
50 lines (42 loc) · 1.72 KB
/
ViewController.swift
File metadata and controls
50 lines (42 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// PXSwiftViewController.swift
// PXImageView
//
// Created by Dave Heyborne on 2.17.16.
// Copyright © 2016 Dave Heyborne. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var contentView: View {
return view as! View
}
override var preferredStatusBarStyle : UIStatusBarStyle {
return UIStatusBarStyle.lightContent
}
override func loadView() {
super.loadView()
view = View()
}
override func viewDidLoad() {
super.viewDidLoad()
title = "PX Infinite Scroll View"
view.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
edgesForExtendedLayout = UIRectEdge()
let faces: [String] = ["andres", "andrew", "ben", "calvin", "daniel", "dillon", "hunsaker", "julie", "jun", "kevin", "lorenzo", "matt", "seth", "spencer", "victor", "william"]
var faceViews: [UIImageView] = []
for face in faces {
let imageView: UIImageView = UIImageView(image: UIImage(named: face))
imageView.contentMode = UIViewContentMode.scaleAspectFit
faceViews.append(imageView)
}
let animals: [String] = ["big bird", "bear", "bugs bunny", "cat", "cow", "duck", "giraffe", "gorilla", "jumping lemur", "lemur", "lion", "penguin", "sloth", "wolf", "as it is"]
var animalViews: [UIImageView] = []
for animal in animals {
let imageView: UIImageView = UIImageView(image: UIImage(named: animal))
imageView.contentMode = UIViewContentMode.scaleAspectFit
animalViews.append(imageView)
}
contentView.faceScrollView.pages = faceViews
contentView.bodyScrollView.pages = animalViews
}
}