Skip to content

Commit 0628694

Browse files
committed
tvOS support, iOS support, readme & screenshot
1 parent 0f2a821 commit 0628694

File tree

24 files changed

+431
-161
lines changed

24 files changed

+431
-161
lines changed

DGParallaxInteractiveTransition.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "DGParallaxInteractiveTransition"
33
s.version = "1.0.0"
4-
s.summary = "This is a summary."
4+
s.summary = "Parallax interactive transition during UIViewController presentation"
55
s.homepage = "https://github.com/Digipolitan/parallax-interactive-transition-swift"
66
s.authors = "Digipolitan"
77
s.source = { :git => "https://github.com/Digipolitan/parallax-interactive-transition-swift.git", :tag => "v#{s.version}" }

DGParallaxInteractiveTransition.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@
502502
);
503503
runOnlyForDeploymentPostprocessing = 0;
504504
shellPath = /bin/sh;
505-
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
505+
shellScript = "if which swiftlint >/dev/null; then\n echo \"ok\"\n#swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
506506
};
507507
A3169E061DE0727A00BABAFD /* Swiftlint */ = {
508508
isa = PBXShellScriptBuildPhase;

README.md

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,79 @@
1-
# DGParallaxInteractiveTransition
1+
DGParallaxInteractiveTransition
2+
=================================
23

3-
## Installation
4+
[![Build Status](https://travis-ci.org/Digipolitan/parallax-interactive-transition-swift.svg?branch=master)](https://travis-ci.org/Digipolitan/parallax-interactive-transition-swift)
5+
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/DGParallaxInteractiveTransition.svg)](https://img.shields.io/cocoapods/v/DGParallaxInteractiveTransition.svg)
6+
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
7+
[![Platform](https://img.shields.io/cocoapods/p/DGParallaxInteractiveTransition.svg?style=flat)](http://cocoadocs.org/docsets/DGParallaxInteractiveTransition)
8+
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](http://twitter.com/Digipolitan)
49

5-
## Features
10+
The `ParallaxInteractiveTransition` add a simple way to perform parallax interactive transition between 2 UIViewController
11+
12+
![Demo iOS](https://github.com/Digipolitan/parallax-interactive-transition-swift/blob/develop/Screenshots/ios_capture.gif?raw=true "Demo iOS")
13+
14+
![Demo tvOS](https://github.com/Digipolitan/parallax-interactive-transition-swift/blob/develop/Screenshots/tvos_capture.gif?raw=true "Demo tvOS")
15+
16+
17+
## Getting Started
18+
19+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
20+
21+
### Prerequisites
22+
23+
Works with iOS 8+, tested on Xcode 8.2
24+
25+
### Installing
26+
27+
To install the `DGParallaxInteractiveTransition` using **cocoapods**
28+
29+
- Add an entry in your Podfile
30+
31+
```
32+
# Uncomment this line to define a global platform for your project
33+
platform :ios, '8.0'
34+
35+
target 'YourTarget' do
36+
frameworks
37+
use_frameworks!
38+
39+
# Pods for YourTarget
40+
pod 'DGParallaxInteractiveTransition'
41+
end
42+
```
43+
44+
- Then install the dependency with the `pod install` command.
45+
46+
## Usage
47+
48+
How to perform the transition
49+
50+
```swift
51+
let viewController = UIViewController()
52+
let parallaxTransition = DGParallaxViewControllerTransition()
53+
parallaxTransition.attach(to: viewController)
54+
self.present(viewController, animated: true, completion: nil)
55+
self.parallaxTransition = parallaxTransition // You must retain the parallax transition
56+
```
57+
58+
### Configuration
59+
60+
You can customize the component by enabling few options:
61+
62+
```swift
63+
let viewController = UIViewController()
64+
let parallaxTransition = DGParallaxViewControllerTransition()
65+
parallaxTransition.presentedViewInsets = UIEdgeInsets(top: 100, left: 0, bottom: 0, right: 0)
66+
parallaxTransition.overlayColor = .gray
67+
parallaxTransition.maximumOverlayAlpha = 0.5
68+
parallaxTransition.attach(to: viewController)
69+
self.present(viewController, animated: true, completion: nil)
70+
self.parallaxTransition = parallaxTransition // You must retain the parallax transition
71+
```
72+
73+
## Built With
74+
75+
[Fastlane](https://fastlane.tools/)
76+
Fastlane is a tool for iOS, Mac, and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles, and releasing your application.
677

778
## Contributing
879

Samples/DGParallaxInteractiveTransitionSample-iOS/DGParallaxInteractiveTransitionSample-iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
A30D63FC1E0D717E00A3CE45 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A30D63FA1E0D717E00A3CE45 /* LaunchScreen.storyboard */; };
1414
A30D640A1E0D71CB00A3CE45 /* DGParallaxInteractiveTransition.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A30D64091E0D71CB00A3CE45 /* DGParallaxInteractiveTransition.framework */; };
1515
A30D640B1E0D71CB00A3CE45 /* DGParallaxInteractiveTransition.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A30D64091E0D71CB00A3CE45 /* DGParallaxInteractiveTransition.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16-
A30D640F1E0D73B300A3CE45 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30D640D1E0D73B300A3CE45 /* ViewController.swift */; };
17-
A30D64101E0D73B300A3CE45 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A30D640E1E0D73B300A3CE45 /* ViewController.xib */; };
16+
A30D640F1E0D73B300A3CE45 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30D640D1E0D73B300A3CE45 /* RootViewController.swift */; };
17+
A30D64101E0D73B300A3CE45 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A30D640E1E0D73B300A3CE45 /* RootViewController.xib */; };
1818
A3AB9D5F1E3250EC005040F7 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3AB9D5D1E3250EC005040F7 /* DetailViewController.swift */; };
1919
A3AB9D601E3250EC005040F7 /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A3AB9D5E1E3250EC005040F7 /* DetailViewController.xib */; };
2020
/* End PBXBuildFile section */
@@ -46,8 +46,8 @@
4646
A30D63FB1E0D717E00A3CE45 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4747
A30D63FD1E0D717E00A3CE45 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4848
A30D64091E0D71CB00A3CE45 /* DGParallaxInteractiveTransition.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DGParallaxInteractiveTransition.framework; sourceTree = BUILT_PRODUCTS_DIR; };
49-
A30D640D1E0D73B300A3CE45 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
50-
A30D640E1E0D73B300A3CE45 /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = "<group>"; };
49+
A30D640D1E0D73B300A3CE45 /* RootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
50+
A30D640E1E0D73B300A3CE45 /* RootViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = "<group>"; };
5151
A3AB9D5D1E3250EC005040F7 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
5252
A3AB9D5E1E3250EC005040F7 /* DetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailViewController.xib; sourceTree = "<group>"; };
5353
/* End PBXFileReference section */
@@ -87,8 +87,8 @@
8787
isa = PBXGroup;
8888
children = (
8989
A30D63F11E0D717E00A3CE45 /* AppDelegate.swift */,
90-
A30D640D1E0D73B300A3CE45 /* ViewController.swift */,
91-
A30D640E1E0D73B300A3CE45 /* ViewController.xib */,
90+
A30D640D1E0D73B300A3CE45 /* RootViewController.swift */,
91+
A30D640E1E0D73B300A3CE45 /* RootViewController.xib */,
9292
A3AB9D5D1E3250EC005040F7 /* DetailViewController.swift */,
9393
A3AB9D5E1E3250EC005040F7 /* DetailViewController.xib */,
9494
A30D63F81E0D717E00A3CE45 /* Assets.xcassets */,
@@ -184,7 +184,7 @@
184184
buildActionMask = 2147483647;
185185
files = (
186186
A30D63FC1E0D717E00A3CE45 /* LaunchScreen.storyboard in Resources */,
187-
A30D64101E0D73B300A3CE45 /* ViewController.xib in Resources */,
187+
A30D64101E0D73B300A3CE45 /* RootViewController.xib in Resources */,
188188
A30D63F91E0D717E00A3CE45 /* Assets.xcassets in Resources */,
189189
A3AB9D601E3250EC005040F7 /* DetailViewController.xib in Resources */,
190190
);
@@ -246,7 +246,7 @@
246246
buildActionMask = 2147483647;
247247
files = (
248248
A3AB9D5F1E3250EC005040F7 /* DetailViewController.swift in Sources */,
249-
A30D640F1E0D73B300A3CE45 /* ViewController.swift in Sources */,
249+
A30D640F1E0D73B300A3CE45 /* RootViewController.swift in Sources */,
250250
A30D63F21E0D717E00A3CE45 /* AppDelegate.swift in Sources */,
251251
);
252252
runOnlyForDeploymentPostprocessing = 0;

Samples/DGParallaxInteractiveTransitionSample-iOS/DGParallaxInteractiveTransitionSample-iOS/AppDelegate.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1515

1616
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1717
let window = UIWindow(frame: UIScreen.main.bounds)
18-
window.rootViewController = UINavigationController(rootViewController: ViewController())
18+
let navigationController = UINavigationController(rootViewController: RootViewController(nibName: "RootViewController", bundle: nil))
19+
navigationController.navigationBar.isTranslucent = false
20+
window.rootViewController = navigationController
1921
self.window = window
2022
window.makeKeyAndVisible()
2123
return true

Samples/DGParallaxInteractiveTransitionSample-iOS/DGParallaxInteractiveTransitionSample-iOS/DetailViewController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import UIKit
1010

1111
class DetailViewController: UIViewController {
1212

13-
override func viewDidLoad() {
14-
super.viewDidLoad()
15-
16-
// Do any additional setup after loading the view.
13+
@IBAction func touchDismiss(_ sender: Any) {
14+
self.dismiss(animated: true, completion: nil)
1715
}
16+
1817
}

Samples/DGParallaxInteractiveTransitionSample-iOS/DGParallaxInteractiveTransitionSample-iOS/DetailViewController.xib

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
</dependencies>
1111
<objects>
1212
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DetailViewController" customModule="DGParallaxInteractiveTransitionSample_iOS" customModuleProvider="target">
13+
<userDefinedRuntimeAttributes>
14+
<userDefinedRuntimeAttribute type="string" keyPath="title" value="DetailViewController"/>
15+
</userDefinedRuntimeAttributes>
1316
<connections>
1417
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
1518
</connections>
@@ -19,18 +22,35 @@
1922
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2023
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2124
<subviews>
22-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BOTTOM" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4ZX-2i-7f7">
23-
<rect key="frame" x="152" y="646" width="71" height="21"/>
25+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="om0-V9-Jji">
26+
<rect key="frame" x="160" y="637" width="54" height="30"/>
27+
<state key="normal" title="Dismiss"/>
28+
<connections>
29+
<action selector="touchDismiss:" destination="-1" eventType="touchUpInside" id="fDU-8w-iZW"/>
30+
</connections>
31+
</button>
32+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gDH-LM-wm3">
33+
<rect key="frame" x="10" y="10" width="355" height="101.5"/>
34+
<constraints>
35+
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="yxp-WB-g0c"/>
36+
</constraints>
37+
<string key="text">Scroll down to dismiss the view controller with interaction
38+
39+
Click to the "dismiss" button to close the view controller without interaction</string>
2440
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2541
<nil key="textColor"/>
2642
<nil key="highlightedColor"/>
2743
</label>
2844
</subviews>
29-
<color key="backgroundColor" red="1" green="0.061523099769999999" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
45+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
3046
<constraints>
31-
<constraint firstAttribute="bottom" secondItem="4ZX-2i-7f7" secondAttribute="bottom" id="RiZ-iK-KeG"/>
32-
<constraint firstItem="4ZX-2i-7f7" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="hj4-xe-U7V"/>
47+
<constraint firstAttribute="bottom" secondItem="om0-V9-Jji" secondAttribute="bottom" id="4cK-Q7-5KI"/>
48+
<constraint firstItem="gDH-LM-wm3" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="10" id="7mI-0m-aFy"/>
49+
<constraint firstAttribute="trailing" secondItem="gDH-LM-wm3" secondAttribute="trailing" constant="10" id="Fhw-1p-p6p"/>
50+
<constraint firstItem="om0-V9-Jji" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="JTG-Mf-od7"/>
51+
<constraint firstItem="gDH-LM-wm3" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="10" id="sIc-bV-NSe"/>
3352
</constraints>
53+
<point key="canvasLocation" x="76" y="-489"/>
3454
</view>
3555
</objects>
3656
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// ViewController.swift
3+
// DGParallaxInteractiveTransitionSample-iOS
4+
//
5+
// Created by Benoit BRIATTE on 23/12/2016.
6+
// Copyright © 2016 Digipolitan. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import DGParallaxInteractiveTransition
11+
12+
class RootViewController: UIViewController {
13+
14+
var parallaxTransition: DGParallaxViewControllerTransition?
15+
16+
@IBAction func touchDisplayDetail(_ sender: Any) {
17+
let detailViewController = DetailViewController(nibName: "DetailViewController", bundle: nil)
18+
let navigationController = UINavigationController(rootViewController: detailViewController)
19+
navigationController.navigationBar.isTranslucent = false
20+
let parallaxTransition = DGParallaxViewControllerTransition()
21+
parallaxTransition.presentedViewInsets = UIEdgeInsets(top: 100, left: 0, bottom: 0, right: 0)
22+
parallaxTransition.overlayColor = .gray
23+
parallaxTransition.maximumOverlayAlpha = 0.5
24+
parallaxTransition.attach(to: navigationController)
25+
self.present(navigationController, animated: true, completion: nil)
26+
self.parallaxTransition = parallaxTransition
27+
}
28+
}
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
1111
<objects>
12-
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ViewController" customModule="DGParallaxInteractiveTransitionSample_iOS" customModuleProvider="target">
12+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RootViewController" customModule="DGParallaxInteractiveTransitionSample_iOS" customModuleProvider="target">
1313
<userDefinedRuntimeAttributes>
14-
<userDefinedRuntimeAttribute type="string" keyPath="title" value="ViewController"/>
14+
<userDefinedRuntimeAttribute type="string" keyPath="title" value="RootViewController"/>
1515
</userDefinedRuntimeAttributes>
1616
<connections>
1717
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
@@ -22,17 +22,20 @@
2222
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2323
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2424
<subviews>
25-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YCU-ft-lXN">
26-
<rect key="frame" x="134" y="151" width="46" height="30"/>
27-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
28-
<state key="normal" title="Button"/>
25+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YCU-ft-lXN">
26+
<rect key="frame" x="88.5" y="318.5" width="199" height="30"/>
27+
<state key="normal" title="Present detail view controller"/>
2928
<connections>
3029
<action selector="touchDisplayDetail:" destination="-1" eventType="touchUpInside" id="21m-Xm-agR"/>
3130
</connections>
3231
</button>
3332
</subviews>
3433
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
35-
<point key="canvasLocation" x="346" y="212"/>
34+
<constraints>
35+
<constraint firstItem="YCU-ft-lXN" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="BbC-xf-zte"/>
36+
<constraint firstItem="YCU-ft-lXN" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="deM-Z7-5o9"/>
37+
</constraints>
38+
<point key="canvasLocation" x="464" y="184"/>
3639
</view>
3740
</objects>
3841
</document>

Samples/DGParallaxInteractiveTransitionSample-iOS/DGParallaxInteractiveTransitionSample-iOS/ViewController.swift

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)