Skip to content

Commit

Permalink
Merge pull request #44 from hyperoslo/fix/demo
Browse files Browse the repository at this point in the history
Update Demo
  • Loading branch information
vadymmarkov authored Jun 30, 2016
2 parents 1d56065 + 954acf3 commit 52616ce
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 65 deletions.
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
osx_image: xcode7.3
language: objective-c
before_install:
- gem install cocoapods

# Use when you don't have third party dependencies
script: xctool -project Pod/Pod.xcodeproj -scheme Tests -sdk iphonesimulator build test

# Use when you have third party dependencies (CocoaPods generates a workspace)
# podfile: Pod/Podfile
# script: xctool -workspace Pod/Pod.xcworkspace -scheme Tests -sdk iphonesimulator build test
script:
- xcodebuild clean build -project Pages.xcodeproj -scheme "Pages-iOS" -sdk iphonesimulator
- xcodebuild test -project Pages.xcodeproj -scheme "Pages-iOS" -sdk iphonesimulator
64 changes: 35 additions & 29 deletions Example/PagesDemo/PagesDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@
objects = {

/* Begin PBXBuildFile section */
AE2AF244A0553133B9C82435 /* Pods_PagesDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F94DB02BD60FBDD9DA33B012 /* Pods_PagesDemo.framework */; };
B5419FC31B8334AF00492760 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B5419FC21B8334AF00492760 /* Main.storyboard */; };
BDA1583B1AD7EEBD0011D55A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDA1583A1AD7EEBD0011D55A /* AppDelegate.swift */; };
BDA158421AD7EEBD0011D55A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BDA158411AD7EEBD0011D55A /* Images.xcassets */; };
E9F823A8FCD41B7C93397B13 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CC842350E1F3977A4540338 /* Pods.framework */; };
D21166C21D246AC500DF0F05 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D21166C11D246AC500DF0F05 /* ViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
5CC842350E1F3977A4540338 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8E6E29859734123F31FE8509 /* Pods-PagesDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagesDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-PagesDemo/Pods-PagesDemo.release.xcconfig"; sourceTree = "<group>"; };
B5419FC21B8334AF00492760 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
BDA158361AD7EEBD0011D55A /* PagesDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PagesDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
BDA158391AD7EEBD0011D55A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BDA1583A1AD7EEBD0011D55A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BDA158411AD7EEBD0011D55A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
D9DD503AB344BF0871B4441C /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
F8B14BD25BC0E85515410177 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
D21166C11D246AC500DF0F05 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
ED566712FA0708F6D81C017F /* Pods-PagesDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagesDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PagesDemo/Pods-PagesDemo.debug.xcconfig"; sourceTree = "<group>"; };
F94DB02BD60FBDD9DA33B012 /* Pods_PagesDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PagesDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
BDA158331AD7EEBD0011D55A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E9F823A8FCD41B7C93397B13 /* Pods.framework in Frameworks */,
AE2AF244A0553133B9C82435 /* Pods_PagesDemo.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -41,8 +44,8 @@
children = (
BDA158371AD7EEBD0011D55A /* PagesDemo */,
146D72941AB782920058798C /* Products */,
DE2970BAE2AAB48699641853 /* Pods */,
2B3869E498899759381B9821 /* Frameworks */,
2901A02E0A66267BD148C8E2 /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand All @@ -56,10 +59,20 @@
name = Products;
sourceTree = "<group>";
};
2901A02E0A66267BD148C8E2 /* Pods */ = {
isa = PBXGroup;
children = (
ED566712FA0708F6D81C017F /* Pods-PagesDemo.debug.xcconfig */,
8E6E29859734123F31FE8509 /* Pods-PagesDemo.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
2B3869E498899759381B9821 /* Frameworks */ = {
isa = PBXGroup;
children = (
5CC842350E1F3977A4540338 /* Pods.framework */,
F94DB02BD60FBDD9DA33B012 /* Pods_PagesDemo.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -71,6 +84,7 @@
BDA1583A1AD7EEBD0011D55A /* AppDelegate.swift */,
BDA158411AD7EEBD0011D55A /* Images.xcassets */,
BDA158381AD7EEBD0011D55A /* Supporting Files */,
D21166C11D246AC500DF0F05 /* ViewController.swift */,
);
path = PagesDemo;
sourceTree = "<group>";
Expand All @@ -83,28 +97,19 @@
name = "Supporting Files";
sourceTree = "<group>";
};
DE2970BAE2AAB48699641853 /* Pods */ = {
isa = PBXGroup;
children = (
D9DD503AB344BF0871B4441C /* Pods.debug.xcconfig */,
F8B14BD25BC0E85515410177 /* Pods.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
BDA158351AD7EEBD0011D55A /* PagesDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = BDA158561AD7EEBD0011D55A /* Build configuration list for PBXNativeTarget "PagesDemo" */;
buildPhases = (
68CCF36CCB2C4C2DE5698059 /* Check Pods Manifest.lock */,
10073011B792E16704D7CFF4 /* 📦 Check Pods Manifest.lock */,
BDA158321AD7EEBD0011D55A /* Sources */,
BDA158331AD7EEBD0011D55A /* Frameworks */,
BDA158341AD7EEBD0011D55A /* Resources */,
C90158BDD28598B55D5A8096 /* Embed Pods Frameworks */,
79E669DFF20956FD8BD4ABCB /* Copy Pods Resources */,
35E7166636F63403946986AF /* 📦 Embed Pods Frameworks */,
C820C599A4B0CF79E65C0F41 /* 📦 Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -162,49 +167,49 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
68CCF36CCB2C4C2DE5698059 /* Check Pods Manifest.lock */ = {
10073011B792E16704D7CFF4 /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "📦 Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
79E669DFF20956FD8BD4ABCB /* Copy Pods Resources */ = {
35E7166636F63403946986AF /* 📦 Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "📦 Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagesDemo/Pods-PagesDemo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C90158BDD28598B55D5A8096 /* Embed Pods Frameworks */ = {
C820C599A4B0CF79E65C0F41 /* 📦 Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "📦 Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagesDemo/Pods-PagesDemo-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand All @@ -214,6 +219,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D21166C21D246AC500DF0F05 /* ViewController.swift in Sources */,
BDA1583B1AD7EEBD0011D55A /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -300,7 +306,7 @@
};
BDA158521AD7EEBD0011D55A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D9DD503AB344BF0871B4441C /* Pods.debug.xcconfig */;
baseConfigurationReference = ED566712FA0708F6D81C017F /* Pods-PagesDemo.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand All @@ -310,7 +316,7 @@
"$(inherited)",
);
INFOPLIST_FILE = PagesDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -321,13 +327,13 @@
};
BDA158531AD7EEBD0011D55A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F8B14BD25BC0E85515410177 /* Pods.release.xcconfig */;
baseConfigurationReference = 8E6E29859734123F31FE8509 /* Pods-PagesDemo.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PagesDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
34 changes: 13 additions & 21 deletions Example/PagesDemo/PagesDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit
import Pages
import Imaginary

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -15,12 +16,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
pages.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Previous Page",
style: .Plain,
target: pages,
action: "previous")
action: #selector(PagesController.previous))

pages.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next Page",
style: .Plain,
target: pages,
action: "next")
action: #selector(PagesController.next))

window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = navigationController
Expand All @@ -30,29 +31,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func pagesControllerInCode() -> PagesController {

let viewController1 = UIViewController()
viewController1.view.backgroundColor = .blackColor()
viewController1.title = "Controller A"
var viewControllers: [UIViewController] = []

let viewController2 = UIViewController()
viewController2.view.backgroundColor = .blueColor()
viewController2.title = "Controller B"
for i in 0..<5 {
if let imageURL = NSURL(string: "https://unsplash.it/375/667/?image=\(i+10)") {
let viewController = ViewController()
viewController.imageView.setImage(imageURL)

let viewController3 = UIViewController()
viewController3.view.backgroundColor = .redColor()
viewController3.title = "Controller C"
viewControllers.append(viewController)
}
}

let viewController4 = UIViewController()
viewController4.view.backgroundColor = .yellowColor()
viewController4.title = "Controller D"
let pages = PagesController(viewControllers)

let pages = PagesController([viewController1,
viewController2,
viewController3,
viewController4
])

pages.enableSwipe = false
pages.enableSwipe = true
pages.showBottomLine = true

return pages
Expand Down
20 changes: 20 additions & 0 deletions Example/PagesDemo/PagesDemo/ViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import UIKit

public class ViewController: UIViewController {

lazy var imageView = UIImageView()

public override func viewDidLoad() {
super.viewDidLoad()

view.addSubview(imageView)

imageView.contentMode = .ScaleAspectFill

imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.topAnchor.constraintEqualToAnchor(view.topAnchor).active = true
imageView.leftAnchor.constraintEqualToAnchor(view.leftAnchor).active = true
imageView.rightAnchor.constraintEqualToAnchor(view.rightAnchor).active = true
imageView.bottomAnchor.constraintEqualToAnchor(view.bottomAnchor).active = true
}
}
8 changes: 6 additions & 2 deletions Example/PagesDemo/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
use_frameworks!

platform :ios, '8.0'
platform :ios, '9.0'

target 'PagesDemo' do
pod 'Pages', path: '../../'
pod 'Imaginary', git: 'https://github.com/hyperoslo/Imaginary'
end

pod 'Pages', path: '../../'
26 changes: 22 additions & 4 deletions Example/PagesDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
PODS:
- Pages (0.6.2)
- Cache (1.4.0):
- CryptoSwift
- CryptoSwift (0.5.1)
- Imaginary (0.1.0):
- Cache
- Pages (0.6.3)

DEPENDENCIES:
- Imaginary (from `https://github.com/hyperoslo/Imaginary`)
- Pages (from `../../`)

EXTERNAL SOURCES:
Imaginary:
:git: https://github.com/hyperoslo/Imaginary
Pages:
:path: ../../
:path: "../../"

CHECKOUT OPTIONS:
Imaginary:
:commit: 4ab2007614aa2397a9ce82c69771f21df3d37cdc
:git: https://github.com/hyperoslo/Imaginary

SPEC CHECKSUMS:
Pages: 6c042132f8c63c34d242789b7763d4c64e9681a0
Cache: 059cf0e10e6c3aec2c402eea19bd6b3aacb3fe9d
CryptoSwift: df42dda18baf6c76347a94e227dbcc0a341304bd
Imaginary: 62a9ce1e6d7831ede429c8221a183f03ec2a90bc
Pages: 71e80bc64040f1176297c327d080d80b7e74b38c

PODFILE CHECKSUM: 651e7c1534e217a37653348ac0245c09a990e37f

COCOAPODS: 0.39.0
COCOAPODS: 1.0.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let pages = PagesController([viewController1, viewController2])
```

## Demo
![untitled](https://cloud.githubusercontent.com/assets/8013017/10394150/674b3046-6e95-11e5-8d35-eabd5e044002.gif)
![untitled](Screenshots/demo.gif)

## Installation

Expand Down
Binary file added Screenshots/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52616ce

Please sign in to comment.