Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Example/Default-568h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
482 changes: 418 additions & 64 deletions Example/PXInfiniteScrollView.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
39 changes: 0 additions & 39 deletions Example/PXInfiniteScrollView/AppDelegate.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down Expand Up @@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down
16 changes: 8 additions & 8 deletions Example/PXInfiniteScrollView/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import UIKit

class View: UIView {
private var _constraints: [NSLayoutConstraint]
fileprivate var _constraints: [NSLayoutConstraint]

let faceScrollView: PXInfiniteScrollView
let bodyScrollView: PXInfiniteScrollView
Expand All @@ -21,10 +21,10 @@ class View: UIView {
super.init(frame: frame)

faceScrollView.translatesAutoresizingMaskIntoConstraints = false
faceScrollView.scrollDirection = PXInfiniteScrollViewDirection.Horizontal
faceScrollView.scrollDirection = PXInfiniteScrollViewDirection.horizontal

bodyScrollView.translatesAutoresizingMaskIntoConstraints = false
bodyScrollView.scrollDirection = PXInfiniteScrollViewDirection.Horizontal
bodyScrollView.scrollDirection = PXInfiniteScrollViewDirection.horizontal

addSubview(bodyScrollView)
addSubview(faceScrollView)
Expand All @@ -43,13 +43,13 @@ class View: UIView {
let views: [String : UIView] = ["faceScrollView" : faceScrollView, "bodyScrollView" : bodyScrollView]
let metrics: [String : Int] = ["spacing" : Int(bounds.height * 0.315), "faceHeight" : 78]

_constraints.appendContentsOf(NSLayoutConstraint.constraintsWithVisualFormat("H:|[bodyScrollView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))
_constraints.appendContentsOf(NSLayoutConstraint.constraintsWithVisualFormat("V:|-spacing-[faceScrollView(faceHeight)]", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))
_constraints.appendContentsOf(NSLayoutConstraint.constraintsWithVisualFormat("V:|[bodyScrollView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))
_constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "H:|[bodyScrollView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))
_constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "V:|-spacing-[faceScrollView(faceHeight)]", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))
_constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "V:|[bodyScrollView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: metrics, views: views))

_constraints.append(NSLayoutConstraint(item: faceScrollView, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: faceScrollView, attribute: NSLayoutAttribute.Height, multiplier: 1.0, constant: 0.0))
_constraints.append(NSLayoutConstraint(item: faceScrollView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: faceScrollView, attribute: NSLayoutAttribute.height, multiplier: 1.0, constant: 0.0))

_constraints.append(NSLayoutConstraint(item: faceScrollView, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.CenterX, multiplier: 1.055, constant: 0.0))
_constraints.append(NSLayoutConstraint(item: faceScrollView, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.centerX, multiplier: 1.055, constant: 0.0))

addConstraints(_constraints)
super.updateConstraints()
Expand Down
3 changes: 0 additions & 3 deletions Example/PXInfiniteScrollView/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
#import <UIKit/UIKit.h>

#import "PXAppDelegate.h"
#import "PXInfiniteScrollView-Swift.h"

int main(int argc, char * argv[])
{
@autoreleasepool {
// COMMENT THIS OUT AND USE THE LINE BELOW TO TEST THE SWIFT EXAMPLE
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PXAppDelegate class]));
//return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
40 changes: 40 additions & 0 deletions Example/PXInfiniteScrollViewSwiftExample/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// PXSwiftAppDelegate.swift
// PXImageView
//
// Created by Dave Heyborne on 2.17.16.
// Copyright © 2016 Dave Heyborne. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()

let controller: ViewController = ViewController()
let navController: UINavigationController = UINavigationController(rootViewController: controller)

navController.navigationBar.barTintColor = UIColor.orange
navController.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]

window?.rootViewController = navController
return true
}

func applicationWillResignActive(_ application: UIApplication) {}

func applicationDidEnterBackground(_ application: UIApplication) {}

func applicationWillEnterForeground(_ application: UIApplication) {}

func applicationDidBecomeActive(_ application: UIApplication) {}

func applicationWillTerminate(_ application: UIApplication) {}
}
41 changes: 41 additions & 0 deletions Example/PXInfiniteScrollViewSwiftExample/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ViewController: UIViewController {
return view as! View
}

override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
override var preferredStatusBarStyle : UIStatusBarStyle {
return UIStatusBarStyle.lightContent
}

override func loadView() {
Expand All @@ -27,21 +27,21 @@ class ViewController: UIViewController {
title = "PX Infinite Scroll View"

view.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
edgesForExtendedLayout = UIRectEdge.None
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
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
imageView.contentMode = UIViewContentMode.scaleAspectFit
animalViews.append(imageView)
}
contentView.faceScrollView.pages = faceViews
Expand Down
22 changes: 22 additions & 0 deletions Example/PXInfiniteScrollViewSwiftExampleTests/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// PXInfiniteScrollViewSwiftExampleTests.swift
// PXInfiniteScrollViewSwiftExampleTests
//
// Created by Michael Biggs on 2/9/17.
// Copyright © 2017 Daniel Blakemore. All rights reserved.
//

import XCTest
@testable import PXInfiniteScrollViewSwiftExample

class PXInfiniteScrollViewSwiftExampleTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
10 changes: 8 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
source 'https://github.com/CocoaPods/Specs.git'

target 'PXInfiniteScrollView', :exclusive => true do
target 'PXInfiniteScrollView' do
pod "PXInfiniteScrollView", :path => "../"
end

target 'Tests', :exclusive => true do
target 'Tests' do
pod "PXInfiniteScrollView", :path => "../"
end

target 'PXInfiniteScrollViewSwiftExample' do
pod "PXInfiniteScrollView", :path => "../"
end

target 'PXInfiniteScrollViewSwiftExampleTests' do
pod "PXInfiniteScrollView", :path => "../"
end
10 changes: 6 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
PODS:
- PXInfiniteScrollView (0.1.2)
- PXInfiniteScrollView (0.2.0)

DEPENDENCIES:
- PXInfiniteScrollView (from `../`)

EXTERNAL SOURCES:
PXInfiniteScrollView:
:path: ../
:path: "../"

SPEC CHECKSUMS:
PXInfiniteScrollView: fcf6c029a5c56c6ad4fab5668b489242dd985cf2
PXInfiniteScrollView: 32552cdd3f0ffb62db6e0acdd9259c9872d34076

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 5210ec298f3f1268e01e676f9030b14c6a2de2db

COCOAPODS: 1.2.0
13 changes: 4 additions & 9 deletions Example/Pods/Local Podspecs/PXInfiniteScrollView.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading