diff --git a/.travis.yml b/.travis.yml
index 7ca3775..b34938b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,5 @@
language: objective-c
+osx_image: xcode7.1
before_install:
- rake install
script:
diff --git a/LICENSE b/LICENSE
index af43243..fb59b36 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014 Raizlabs and other contributors
+Copyright (c) 2015 Raizlabs and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/README.md b/README.md
index f41ad05..d995f36 100644
--- a/README.md
+++ b/README.md
@@ -19,9 +19,9 @@
Add the following to your Podfile:
-`pod 'RZTransitions', '~> 1.0'`
+`pod 'RZTransitions'`
-RZTransitions follows semantic versioning conventions. Check the [releases page](https://github.com/Raizlabs/RZTransitions/releases) for the latest updates and version history.
+RZTransitions follows semantic versioning conventions. Check the [releases page](https://github.com/Raizlabs/RZTransitions/releases) for the latest updates and version history.
### Manual Installation
@@ -29,6 +29,13 @@ Copy and add all of the files in the `RZTransitions` directory (and its subdirec
## Setting a New Default Transition
+
Swift
+```Swift
+RZTransitionsManager.shared().defaultPresentDismissAnimationController = RZZoomAlphaAnimationController()
+RZTransitionsManager.shared().defaultPushPopAnimationController = RZCardSlideAnimationController()
+```
+
+Objective C
```objective-c
id presentDismissAnimationController = [[RZZoomAlphaAnimationController alloc] init];
id pushPopAnimationController = [[RZCardSlideAnimationController alloc] init];
@@ -38,6 +45,14 @@ id pushPopAnimationController = [[RZCardSlideAnim
When Presenting a View Controller
+Swift
+```Swift
+self.transitioningDelegate = RZTransitionsManager.shared()
+let nextViewController = UIViewController()
+nextViewController.transitioningDelegate = RZTransitionsManager.shared()
+self.presentViewController(nextViewController, animated:true) {}
+```
+Objective C
```objective-c
[self setTransitioningDelegate:[RZTransitionsManager shared]];
UIViewController *nextViewController = [[UIViewController alloc] init];
@@ -47,6 +62,12 @@ UIViewController *nextViewController = [[UIViewController alloc] init];
When creating a Navigation Controller ( **or** use RZTransitionsNavigationController )
+Swift
+```Swift
+let navigationController = UINavigationController()
+navigationController.delegate = RZTransitionsManager.shared()
+```
+Objective C
```objective-c
UINavigationController *navigationController = [[UINavigationController alloc] init];
[navigationController setDelegate:[RZTransitionsManager shared]];
@@ -54,6 +75,14 @@ UINavigationController *navigationController = [[UINavigationController alloc] i
## Specifying Transitions for Specific View Controllers
+Swift
+```Swift
+RZTransitionsManager.shared().setAnimationController( RZZoomPushAnimationController(),
+ fromViewController:self.dynamicType,
+ toViewController:RZSimpleCollectionViewController.self,
+ forAction:.PushPop)
+```
+Objective C
```objective-c
// Use the RZZoomPushAnimationController when pushing from this view controller to a
// RZSimpleCollectionViewController or popping from a RZSimpleCollectionViewController to
@@ -66,6 +95,28 @@ UINavigationController *navigationController = [[UINavigationController alloc] i
## Hooking up Interactors
+Swift
+```Swift
+override func viewDidLoad() {
+ super.viewDidLoad()
+
+ self.presentInteractionController = RZVerticalSwipeInteractionController()
+ if let vc = self.presentInteractionController as? RZVerticalSwipeInteractionController {
+ vc.nextViewControllerDelegate = self
+ vc.attachViewController(self, withAction:.Present)
+ }
+}
+
+override func viewWillAppear(animated: Bool)
+{
+ super.viewWillAppear(animated)
+ RZTransitionsManager.shared().setInteractionController( self.presentInteractionController,
+ fromViewController:self.dynamicType,
+ toViewController:nil,
+ forAction:.Present)
+}
+```
+Objective C
```objective-c
@property (nonatomic, strong) id presentInteractionController;
@@ -96,7 +147,7 @@ UINavigationController *navigationController = [[UINavigationController alloc] i
- A comprehensive library of interaction controllers
- Mix and match any animation controller with any interaction controller
- A shared instance manager that helps wrap the iOS7 custom transition protocol to expose a friendlier API
-
+
You can use any of the animation controllers or interaction controllers without the RZTransitionsManager and simply use them with the iOS7 custom View Controller transition APIs.
## Maintainers
@@ -113,7 +164,7 @@ You can use any of the animation controllers or interaction controllers without
## Contributors
-[smbarne](https://github.com/smbarne) ([@smbarne](http://twitter.com/smbarne))
+[smbarne](https://github.com/smbarne) ([@smbarne](http://twitter.com/smbarne))
## License
diff --git a/RZTransitions-Demo/Default-568h@2x.png b/RZTransitions-Demo/Default-568h@2x.png
new file mode 100644
index 0000000..0891b7a
Binary files /dev/null and b/RZTransitions-Demo/Default-568h@2x.png differ
diff --git a/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/project.pbxproj b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/project.pbxproj
index 8387bb7..103c3f9 100644
--- a/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/project.pbxproj
+++ b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 47;
objects = {
/* Begin PBXBuildFile section */
@@ -45,6 +45,41 @@
9A0F7CA5195A0B9500271D1D /* RZZoomPushAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C90195A0B9500271D1D /* RZZoomPushAnimationController.m */; };
9A0F7CA6195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C93195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.m */; };
9A0F7CA7195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C95195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.m */; };
+ E11760241BFFC16A0071800D /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E11760221BFFC16A0071800D /* Launch Screen.xib */; };
+ E16E52791C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = E16E52781C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m */; };
+ E16E527B1C0E18AE009751AD /* NSObject+RZTransitionsViewHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = E16E52781C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m */; };
+ E18786DA1BFB5FB000E51D79 /* UIColor+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = E18786D91BFB5FB000E51D79 /* UIColor+Random.swift */; };
+ E19CA4AA1BF539F4007F3FF5 /* RZTransitionsDemoAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E19CA4A91BF539F4007F3FF5 /* RZTransitionsDemoAppDelegate.swift */; };
+ E1A793301BF677BC008D27EE /* RZSimpleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 833E36EC184E5AFF00A0326A /* RZSimpleViewController.xib */; };
+ E1A793311BF677BC008D27EE /* RZSimpleColorViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 833E3701184E5DB400A0326A /* RZSimpleColorViewController.xib */; };
+ E1A793321BF677BC008D27EE /* RZSimpleCollectionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 837D08C11859000F00E20B37 /* RZSimpleCollectionViewController.xib */; };
+ E1A793341BF67ABD008D27EE /* RZTransitionsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C69195A0B9500271D1D /* RZTransitionsNavigationController.m */; };
+ E1A793351BF67B0B008D27EE /* RZTransitionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C7D195A0B9500271D1D /* RZTransitionsManager.m */; };
+ E1A793361BF67B56008D27EE /* RZUniqueTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C6D195A0B9500271D1D /* RZUniqueTransition.m */; };
+ E1A793371BF67C90008D27EE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 833E36BF184E29C300A0326A /* Images.xcassets */; };
+ E1A793381BF67CA2008D27EE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 833E36B0184E29C300A0326A /* InfoPlist.strings */; };
+ E1A793561BF67FA8008D27EE /* RZBaseSwipeInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C70195A0B9500271D1D /* RZBaseSwipeInteractionController.m */; };
+ E1A793571BF67FA8008D27EE /* RZHorizontalInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C72195A0B9500271D1D /* RZHorizontalInteractionController.m */; };
+ E1A793581BF67FA8008D27EE /* RZOverscrollInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C74195A0B9500271D1D /* RZOverscrollInteractionController.m */; };
+ E1A793591BF67FA8008D27EE /* RZPinchInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C76195A0B9500271D1D /* RZPinchInteractionController.m */; };
+ E1A7935A1BF67FA8008D27EE /* RZVerticalSwipeInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C7A195A0B9500271D1D /* RZVerticalSwipeInteractionController.m */; };
+ E1A7935B1BF67FA8008D27EE /* RZCardSlideAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C81195A0B9500271D1D /* RZCardSlideAnimationController.m */; };
+ E1A7935C1BF67FA8008D27EE /* RZCirclePushAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C83195A0B9500271D1D /* RZCirclePushAnimationController.m */; };
+ E1A7935D1BF67FA8008D27EE /* RZRectZoomAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C85195A0B9500271D1D /* RZRectZoomAnimationController.m */; };
+ E1A7935E1BF67FA8008D27EE /* RZSegmentControlMoveFadeAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C87195A0B9500271D1D /* RZSegmentControlMoveFadeAnimationController.m */; };
+ E1A7935F1BF67FA8008D27EE /* RZShrinkZoomAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C89195A0B9500271D1D /* RZShrinkZoomAnimationController.m */; };
+ E1A793601BF67FA8008D27EE /* RZZoomAlphaAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C8C195A0B9500271D1D /* RZZoomAlphaAnimationController.m */; };
+ E1A793611BF67FA8008D27EE /* RZZoomBlurAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C8E195A0B9500271D1D /* RZZoomBlurAnimationController.m */; };
+ E1A793621BF67FA8008D27EE /* RZZoomPushAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C90195A0B9500271D1D /* RZZoomPushAnimationController.m */; };
+ E1A793631BF67FA8008D27EE /* UIImage+RZTransitionsFastImageBlur.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C93195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.m */; };
+ E1A793641BF67FA8008D27EE /* UIImage+RZTransitionsSnapshotHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0F7C95195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.m */; };
+ E1A793681BF6833E008D27EE /* RZSimpleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E74E611BF649B400C00BD2 /* RZSimpleViewController.swift */; };
+ E1C37BB41C04FE9E00F2B87D /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E1C37BB21C04FE9E00F2B87D /* LICENSE */; };
+ E1C37BB81C04FF3200F2B87D /* ReadMeSnippets.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C37BB61C04FEBD00F2B87D /* ReadMeSnippets.swift */; };
+ E1C37BBA1C04FFB000F2B87D /* ReadMeSnippets.m in Sources */ = {isa = PBXBuildFile; fileRef = E1C37BB91C04FFB000F2B87D /* ReadMeSnippets.m */; };
+ E1EA18F31BFA923600F471EC /* RZSimpleColorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EA18F21BFA923600F471EC /* RZSimpleColorViewController.swift */; };
+ E1EA18F51BFABA4800F471EC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1EA18F41BFABA4800F471EC /* Default-568h@2x.png */; };
+ E1EA18F71BFABD7400F471EC /* RZSimpleCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EA18F61BFABD7400F471EC /* RZSimpleCollectionViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -107,18 +142,18 @@
9A0F7C7D195A0B9500271D1D /* RZTransitionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZTransitionsManager.m; sourceTree = ""; };
9A0F7C7F195A0B9500271D1D /* RZAnimationControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZAnimationControllerProtocol.h; sourceTree = ""; };
9A0F7C80195A0B9500271D1D /* RZCardSlideAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZCardSlideAnimationController.h; sourceTree = ""; };
- 9A0F7C81195A0B9500271D1D /* RZCardSlideAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZCardSlideAnimationController.m; sourceTree = ""; };
+ 9A0F7C81195A0B9500271D1D /* RZCardSlideAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RZCardSlideAnimationController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
9A0F7C82195A0B9500271D1D /* RZCirclePushAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZCirclePushAnimationController.h; sourceTree = ""; };
- 9A0F7C83195A0B9500271D1D /* RZCirclePushAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZCirclePushAnimationController.m; sourceTree = ""; };
+ 9A0F7C83195A0B9500271D1D /* RZCirclePushAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RZCirclePushAnimationController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
9A0F7C84195A0B9500271D1D /* RZRectZoomAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZRectZoomAnimationController.h; sourceTree = ""; };
9A0F7C85195A0B9500271D1D /* RZRectZoomAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZRectZoomAnimationController.m; sourceTree = ""; };
9A0F7C86195A0B9500271D1D /* RZSegmentControlMoveFadeAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZSegmentControlMoveFadeAnimationController.h; sourceTree = ""; };
- 9A0F7C87195A0B9500271D1D /* RZSegmentControlMoveFadeAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZSegmentControlMoveFadeAnimationController.m; sourceTree = ""; };
+ 9A0F7C87195A0B9500271D1D /* RZSegmentControlMoveFadeAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RZSegmentControlMoveFadeAnimationController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
9A0F7C88195A0B9500271D1D /* RZShrinkZoomAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZShrinkZoomAnimationController.h; sourceTree = ""; };
- 9A0F7C89195A0B9500271D1D /* RZShrinkZoomAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZShrinkZoomAnimationController.m; sourceTree = ""; };
+ 9A0F7C89195A0B9500271D1D /* RZShrinkZoomAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RZShrinkZoomAnimationController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
9A0F7C8A195A0B9500271D1D /* RZTransitionsAnimationControllers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZTransitionsAnimationControllers.h; sourceTree = ""; };
9A0F7C8B195A0B9500271D1D /* RZZoomAlphaAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZZoomAlphaAnimationController.h; sourceTree = ""; };
- 9A0F7C8C195A0B9500271D1D /* RZZoomAlphaAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZZoomAlphaAnimationController.m; sourceTree = ""; };
+ 9A0F7C8C195A0B9500271D1D /* RZZoomAlphaAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = RZZoomAlphaAnimationController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
9A0F7C8D195A0B9500271D1D /* RZZoomBlurAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZZoomBlurAnimationController.h; sourceTree = ""; };
9A0F7C8E195A0B9500271D1D /* RZZoomBlurAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZZoomBlurAnimationController.m; sourceTree = ""; };
9A0F7C8F195A0B9500271D1D /* RZZoomPushAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RZZoomPushAnimationController.h; sourceTree = ""; };
@@ -127,6 +162,22 @@
9A0F7C93195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+RZTransitionsFastImageBlur.m"; sourceTree = ""; };
9A0F7C94195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+RZTransitionsSnapshotHelpers.h"; sourceTree = ""; };
9A0F7C95195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+RZTransitionsSnapshotHelpers.m"; sourceTree = ""; };
+ E11760231BFFC16A0071800D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = "en.lproj/Launch Screen.xib"; sourceTree = ""; };
+ E16E52771C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+RZTransitionsViewHelpers.h"; sourceTree = ""; };
+ E16E52781C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+RZTransitionsViewHelpers.m"; sourceTree = ""; };
+ E18786D91BFB5FB000E51D79 /* UIColor+Random.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Random.swift"; sourceTree = ""; };
+ E19CA4971BF5391A007F3FF5 /* RZTransitions-Demo-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RZTransitions-Demo-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ E19CA4A91BF539F4007F3FF5 /* RZTransitionsDemoAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RZTransitionsDemoAppDelegate.swift; sourceTree = ""; };
+ E1A7932F1BF65348008D27EE /* RZTransitions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZTransitions.h; sourceTree = ""; };
+ E1C37BB21C04FE9E00F2B87D /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
+ E1C37BB31C04FE9E00F2B87D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
+ E1C37BB61C04FEBD00F2B87D /* ReadMeSnippets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReadMeSnippets.swift; sourceTree = ""; };
+ E1C37BB91C04FFB000F2B87D /* ReadMeSnippets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReadMeSnippets.m; sourceTree = ""; };
+ E1C37BBB1C0507E700F2B87D /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = ""; };
+ E1E74E611BF649B400C00BD2 /* RZSimpleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RZSimpleViewController.swift; sourceTree = ""; };
+ E1EA18F21BFA923600F471EC /* RZSimpleColorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RZSimpleColorViewController.swift; sourceTree = ""; };
+ E1EA18F41BFABA4800F471EC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
+ E1EA18F61BFABD7400F471EC /* RZSimpleCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RZSimpleCollectionViewController.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -150,12 +201,21 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ E19CA4941BF5391A007F3FF5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
833E369B184E29C300A0326A = {
isa = PBXGroup;
children = (
+ E1C37BB11C04FE7F00F2B87D /* Documentation */,
+ E1EA18F41BFABA4800F471EC /* Default-568h@2x.png */,
9A0F7C66195A0B9500271D1D /* RZTransitions */,
833E36AD184E29C300A0326A /* RZTransitions-Demo */,
833E36CC184E29C300A0326A /* RZTransitions-DemoTests */,
@@ -169,6 +229,7 @@
children = (
833E36A4184E29C300A0326A /* RZTransitions-Demo.app */,
833E36C5184E29C300A0326A /* RZTransitions-DemoTests.xctest */,
+ E19CA4971BF5391A007F3FF5 /* RZTransitions-Demo-Swift.app */,
);
name = Products;
sourceTree = "";
@@ -204,6 +265,8 @@
833E36B0184E29C300A0326A /* InfoPlist.strings */,
833E36B3184E29C300A0326A /* main.m */,
833E36B5184E29C300A0326A /* RZTransitions-Demo-Prefix.pch */,
+ E11760221BFFC16A0071800D /* Launch Screen.xib */,
+ E1C37BBB1C0507E700F2B87D /* Bridging-Header.h */,
);
name = "Supporting Files";
sourceTree = "";
@@ -231,6 +294,7 @@
children = (
833E36E7184E5A9A00A0326A /* RZTransitionsDemoAppDelegate.h */,
833E36E8184E5A9A00A0326A /* RZTransitionsDemoAppDelegate.m */,
+ E19CA4A91BF539F4007F3FF5 /* RZTransitionsDemoAppDelegate.swift */,
);
path = Application;
sourceTree = "";
@@ -250,6 +314,7 @@
children = (
83855D08185F98E3004DB036 /* UIColor+Random.h */,
83855D09185F98E3004DB036 /* UIColor+Random.m */,
+ E18786D91BFB5FB000E51D79 /* UIColor+Random.swift */,
);
name = Utilities;
path = "RZTransitions-Demo/Utilities";
@@ -258,6 +323,7 @@
9A0F7C66195A0B9500271D1D /* RZTransitions */ = {
isa = PBXGroup;
children = (
+ E1A7932F1BF65348008D27EE /* RZTransitions.h */,
9A0F7C67195A0B9500271D1D /* Components */,
9A0F7C6A195A0B9500271D1D /* Data */,
9A0F7C6E195A0B9500271D1D /* Interactors */,
@@ -344,6 +410,8 @@
9A0F7C91195A0B9500271D1D /* Utilities */ = {
isa = PBXGroup;
children = (
+ E16E52771C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.h */,
+ E16E52781C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m */,
9A0F7C92195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.h */,
9A0F7C93195A0B9500271D1D /* UIImage+RZTransitionsFastImageBlur.m */,
9A0F7C94195A0B9500271D1D /* UIImage+RZTransitionsSnapshotHelpers.h */,
@@ -357,6 +425,7 @@
children = (
833E36EA184E5AFF00A0326A /* RZSimpleViewController.h */,
833E36EB184E5AFF00A0326A /* RZSimpleViewController.m */,
+ E1E74E611BF649B400C00BD2 /* RZSimpleViewController.swift */,
833E36EC184E5AFF00A0326A /* RZSimpleViewController.xib */,
);
name = "Simple View Controller";
@@ -367,6 +436,7 @@
children = (
833E36FF184E5DB400A0326A /* RZSimpleColorViewController.h */,
833E3700184E5DB400A0326A /* RZSimpleColorViewController.m */,
+ E1EA18F21BFA923600F471EC /* RZSimpleColorViewController.swift */,
833E3701184E5DB400A0326A /* RZSimpleColorViewController.xib */,
);
name = "Simple Color View Controller";
@@ -378,10 +448,22 @@
837D08BF1859000F00E20B37 /* RZSimpleCollectionViewController.h */,
837D08C01859000F00E20B37 /* RZSimpleCollectionViewController.m */,
837D08C11859000F00E20B37 /* RZSimpleCollectionViewController.xib */,
+ E1EA18F61BFABD7400F471EC /* RZSimpleCollectionViewController.swift */,
);
name = "Simple Collection View Controller";
sourceTree = "";
};
+ E1C37BB11C04FE7F00F2B87D /* Documentation */ = {
+ isa = PBXGroup;
+ children = (
+ E1C37BB21C04FE9E00F2B87D /* LICENSE */,
+ E1C37BB31C04FE9E00F2B87D /* README.md */,
+ E1C37BB61C04FEBD00F2B87D /* ReadMeSnippets.swift */,
+ E1C37BB91C04FFB000F2B87D /* ReadMeSnippets.m */,
+ );
+ name = Documentation;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -420,6 +502,23 @@
productReference = 833E36C5184E29C300A0326A /* RZTransitions-DemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
+ E19CA4961BF5391A007F3FF5 /* RZTransitions-Demo-Swift */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = E19CA4A81BF5391A007F3FF5 /* Build configuration list for PBXNativeTarget "RZTransitions-Demo-Swift" */;
+ buildPhases = (
+ E19CA4931BF5391A007F3FF5 /* Sources */,
+ E19CA4941BF5391A007F3FF5 /* Frameworks */,
+ E19CA4951BF5391A007F3FF5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "RZTransitions-Demo-Swift";
+ productName = "RZTransitions-Demo-Swift";
+ productReference = E19CA4971BF5391A007F3FF5 /* RZTransitions-Demo-Swift.app */;
+ productType = "com.apple.product-type.application";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -427,16 +526,20 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = RZ;
- LastUpgradeCheck = 0510;
+ LastSwiftUpdateCheck = 0710;
+ LastUpgradeCheck = 0710;
ORGANIZATIONNAME = Raizlabs;
TargetAttributes = {
833E36C4184E29C300A0326A = {
TestTargetID = 833E36A3184E29C300A0326A;
};
+ E19CA4961BF5391A007F3FF5 = {
+ CreatedOnToolsVersion = 7.1.1;
+ };
};
};
buildConfigurationList = 833E369F184E29C300A0326A /* Build configuration list for PBXProject "RZTransitions-Demo" */;
- compatibilityVersion = "Xcode 3.2";
+ compatibilityVersion = "Xcode 6.3";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
@@ -449,6 +552,7 @@
projectRoot = "";
targets = (
833E36A3184E29C300A0326A /* RZTransitions-Demo */,
+ E19CA4961BF5391A007F3FF5 /* RZTransitions-Demo-Swift */,
833E36C4184E29C300A0326A /* RZTransitions-DemoTests */,
);
};
@@ -461,9 +565,11 @@
files = (
833E3703184E5DB400A0326A /* RZSimpleColorViewController.xib in Resources */,
833E36EE184E5AFF00A0326A /* RZSimpleViewController.xib in Resources */,
+ E1C37BB41C04FE9E00F2B87D /* LICENSE in Resources */,
833E36C0184E29C300A0326A /* Images.xcassets in Resources */,
837D08C31859000F00E20B37 /* RZSimpleCollectionViewController.xib in Resources */,
833E36B2184E29C300A0326A /* InfoPlist.strings in Resources */,
+ E11760241BFFC16A0071800D /* Launch Screen.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -475,6 +581,19 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ E19CA4951BF5391A007F3FF5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E1A793381BF67CA2008D27EE /* InfoPlist.strings in Resources */,
+ E1A793371BF67C90008D27EE /* Images.xcassets in Resources */,
+ E1A793301BF677BC008D27EE /* RZSimpleViewController.xib in Resources */,
+ E1A793321BF677BC008D27EE /* RZSimpleCollectionViewController.xib in Resources */,
+ E1A793311BF677BC008D27EE /* RZSimpleColorViewController.xib in Resources */,
+ E1EA18F51BFABA4800F471EC /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -495,8 +614,10 @@
837D08C21859000F00E20B37 /* RZSimpleCollectionViewController.m in Sources */,
833E3702184E5DB400A0326A /* RZSimpleColorViewController.m in Sources */,
9A0F7C9D195A0B9500271D1D /* RZTransitionsManager.m in Sources */,
+ E16E52791C0E1864009751AD /* NSObject+RZTransitionsViewHelpers.m in Sources */,
9A0F7CA4195A0B9500271D1D /* RZZoomBlurAnimationController.m in Sources */,
9A0F7C9F195A0B9500271D1D /* RZCirclePushAnimationController.m in Sources */,
+ E1C37BBA1C04FFB000F2B87D /* ReadMeSnippets.m in Sources */,
833E36ED184E5AFF00A0326A /* RZSimpleViewController.m in Sources */,
9A0F7CA2195A0B9500271D1D /* RZShrinkZoomAnimationController.m in Sources */,
833E36B4184E29C300A0326A /* main.m in Sources */,
@@ -518,6 +639,38 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ E19CA4931BF5391A007F3FF5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E1A793611BF67FA8008D27EE /* RZZoomBlurAnimationController.m in Sources */,
+ E1A793591BF67FA8008D27EE /* RZPinchInteractionController.m in Sources */,
+ E1A793681BF6833E008D27EE /* RZSimpleViewController.swift in Sources */,
+ E1A7935E1BF67FA8008D27EE /* RZSegmentControlMoveFadeAnimationController.m in Sources */,
+ E19CA4AA1BF539F4007F3FF5 /* RZTransitionsDemoAppDelegate.swift in Sources */,
+ E1A7935D1BF67FA8008D27EE /* RZRectZoomAnimationController.m in Sources */,
+ E1A7935C1BF67FA8008D27EE /* RZCirclePushAnimationController.m in Sources */,
+ E1A793581BF67FA8008D27EE /* RZOverscrollInteractionController.m in Sources */,
+ E1EA18F31BFA923600F471EC /* RZSimpleColorViewController.swift in Sources */,
+ E1A7935A1BF67FA8008D27EE /* RZVerticalSwipeInteractionController.m in Sources */,
+ E1A7935F1BF67FA8008D27EE /* RZShrinkZoomAnimationController.m in Sources */,
+ E1A793621BF67FA8008D27EE /* RZZoomPushAnimationController.m in Sources */,
+ E1A793351BF67B0B008D27EE /* RZTransitionsManager.m in Sources */,
+ E1A7935B1BF67FA8008D27EE /* RZCardSlideAnimationController.m in Sources */,
+ E1A793341BF67ABD008D27EE /* RZTransitionsNavigationController.m in Sources */,
+ E1A793601BF67FA8008D27EE /* RZZoomAlphaAnimationController.m in Sources */,
+ E18786DA1BFB5FB000E51D79 /* UIColor+Random.swift in Sources */,
+ E1A793571BF67FA8008D27EE /* RZHorizontalInteractionController.m in Sources */,
+ E1C37BB81C04FF3200F2B87D /* ReadMeSnippets.swift in Sources */,
+ E1EA18F71BFABD7400F471EC /* RZSimpleCollectionViewController.swift in Sources */,
+ E1A793631BF67FA8008D27EE /* UIImage+RZTransitionsFastImageBlur.m in Sources */,
+ E1A793561BF67FA8008D27EE /* RZBaseSwipeInteractionController.m in Sources */,
+ E1A793641BF67FA8008D27EE /* UIImage+RZTransitionsSnapshotHelpers.m in Sources */,
+ E1A793361BF67B56008D27EE /* RZUniqueTransition.m in Sources */,
+ E16E527B1C0E18AE009751AD /* NSObject+RZTransitionsViewHelpers.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@@ -545,6 +698,14 @@
name = InfoPlist.strings;
sourceTree = "";
};
+ E11760221BFFC16A0071800D /* Launch Screen.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ E11760231BFFC16A0071800D /* en */,
+ );
+ name = "Launch Screen.xib";
+ sourceTree = "";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -562,10 +723,13 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
+ CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = NO;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
+ ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -583,6 +747,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
+ SWIFT_OBJC_BRIDGING_HEADER = "";
+ WARNING_CFLAGS = "-Wincomplete-umbrella";
};
name = Debug;
};
@@ -600,6 +766,8 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
+ CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = NO;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -613,8 +781,11 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
+ SWIFT_OBJC_BRIDGING_HEADER = "";
VALIDATE_PRODUCT = YES;
+ WARNING_CFLAGS = "-Wincomplete-umbrella";
};
name = Release;
};
@@ -626,7 +797,11 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RZTransitions-Demo/RZTransitions-Demo-Prefix.pch";
INFOPLIST_FILE = "RZTransitions-Demo/RZTransitions-Demo-Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
name = Debug;
@@ -639,7 +814,10 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RZTransitions-Demo/RZTransitions-Demo-Prefix.pch";
INFOPLIST_FILE = "RZTransitions-Demo/RZTransitions-Demo-Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
name = Release;
@@ -660,6 +838,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist";
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
@@ -678,12 +857,62 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RZTransitions-Demo/RZTransitions-Demo-Prefix.pch";
INFOPLIST_FILE = "RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist";
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
+ E19CA4A61BF5391A007F3FF5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = "RZTransitions-Demo/RZTransitions-Demo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.RZTransitions-Demo-Swift";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "RZTransitions-Demo/Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ E19CA4A71BF5391A007F3FF5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = "RZTransitions-Demo/RZTransitions-Demo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.RZTransitions-Demo-Swift";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "RZTransitions-Demo/Bridging-Header.h";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -714,6 +943,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ E19CA4A81BF5391A007F3FF5 /* Build configuration list for PBXNativeTarget "RZTransitions-Demo-Swift" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ E19CA4A61BF5391A007F3FF5 /* Debug */,
+ E19CA4A71BF5391A007F3FF5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 833E369C184E29C300A0326A /* Project object */;
diff --git a/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo-Swift.xcscheme b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo-Swift.xcscheme
new file mode 100644
index 0000000..41fa674
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo-Swift.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo.xcscheme b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo.xcscheme
index 0ea017e..eddc115 100644
--- a/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo.xcscheme
+++ b/RZTransitions-Demo/RZTransitions-Demo.xcodeproj/xcshareddata/xcschemes/RZTransitions-Demo.xcscheme
@@ -1,6 +1,6 @@
+ shouldUseLaunchSchemeArgsEnv = "YES">
@@ -48,17 +48,21 @@
ReferencedContainer = "container:RZTransitions-Demo.xcodeproj">
+
+
-
+
-
+
Bool {
+
+ RZTransitionsManager.shared().defaultPresentDismissAnimationController = RZZoomAlphaAnimationController()
+ RZTransitionsManager.shared().defaultPushPopAnimationController = RZCardSlideAnimationController()
+
+ let rootViewController = RZSimpleViewController()
+ let rootNavController = RZTransitionsNavigationController(rootViewController: rootViewController)
+
+ window = UIWindow(frame: UIScreen.mainScreen().bounds)
+ window?.rootViewController = rootNavController
+ window?.makeKeyAndVisible()
+
+ return true
+ }
+}
diff --git a/RZTransitions-Demo/RZTransitions-Demo/Bridging-Header.h b/RZTransitions-Demo/RZTransitions-Demo/Bridging-Header.h
new file mode 100644
index 0000000..96044d6
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/Bridging-Header.h
@@ -0,0 +1,14 @@
+//
+// Bridging-Header.h
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/24/15.
+// Copyright © 2015 Raizlabs. All rights reserved.
+//
+
+#ifndef Header_h
+#define Header_h
+
+#import "RZTransitions.h"
+
+#endif /* Header_h */
diff --git a/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/AppIcon.appiconset/Contents.json b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
index a396706..118c98f 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -5,15 +5,30 @@
"size" : "29x29",
"scale" : "2x"
},
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
}
],
"info" : {
diff --git a/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/Contents.json b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
index c79ebd3..fadb823 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
+++ b/RZTransitions-Demo/RZTransitions-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json
@@ -10,9 +10,9 @@
{
"orientation" : "portrait",
"idiom" : "iphone",
- "subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
+ "subtype" : "retina4",
"scale" : "2x"
}
],
diff --git a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Info.plist b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Info.plist
index 3712bde..c3fdacd 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Info.plist
+++ b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Info.plist
@@ -9,7 +9,7 @@
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
- com.raizlabs.${PRODUCT_NAME:rfc1034identifier}
+ $(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
@@ -24,6 +24,8 @@
1.0
LSRequiresIPhoneOS
+ UILaunchStoryboardName
+ Launch Screen
UIRequiredDeviceCapabilities
armv7
diff --git a/RZTransitions-Demo/RZTransitions-Demo/Utilities/UIColor+Random.swift b/RZTransitions-Demo/RZTransitions-Demo/Utilities/UIColor+Random.swift
new file mode 100644
index 0000000..5e78be4
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/Utilities/UIColor+Random.swift
@@ -0,0 +1,38 @@
+//
+// UIColor+Random.swift
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/17/15.
+// Copyright 2015 Raizlabs and other contributors
+// http://raizlabs.com/
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import UIKit
+
+extension UIColor {
+
+ public class func randomColor() -> UIColor {
+ let hue = CGFloat(arc4random_uniform(256)) / 256.0 // 0.0 to 1.0
+ let saturation = CGFloat(arc4random_uniform(128)) / 256.0 + 0.5 // 0.5 to 1.0, away from white
+ let brightness = CGFloat(arc4random_uniform(128)) / 256.0 + 0.5 // 0.5 to 1.0, away from black
+ return UIColor(hue:hue, saturation:saturation, brightness:brightness, alpha:1.0)
+ }
+}
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.swift b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.swift
new file mode 100644
index 0000000..64c7e27
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.swift
@@ -0,0 +1,150 @@
+
+// RZSimpleCollectionViewController.swift
+// RZTransitions-Demo
+
+// Created by Eric Slosser on 11/16/15.
+// Copyright © 2015 Raizlabs and other contributors.
+// http://raizlabs.com/
+
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+import CoreGraphics
+import UIKit
+
+let kRZCollectionViewCellReuseId = "kRZCollectionViewCellReuseId"
+let kRZCollectionViewNumCells = 50
+let kRZCollectionViewCellSize: CGFloat = 88
+
+@objc(RZSimpleCollectionViewController)
+final class RZSimpleCollectionViewController: UIViewController
+ , UICollectionViewDataSource
+ , UICollectionViewDelegate
+ , UIViewControllerTransitioningDelegate
+ , RZTransitionInteractionControllerDelegate
+ , RZCirclePushAnimationDelegate
+ , RZRectZoomAnimationDelegate
+{
+ @IBOutlet weak var collectionView: UICollectionView?
+
+ var circleTransitionStartPoint: CGPoint = CGPointZero
+ var transitionCellRect: CGRect = CGRectZero
+ var presentOverscrollInteractor: RZOverscrollInteractionController?
+ var presentDismissAnimationController: RZRectZoomAnimationController?
+
+ override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
+ super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ super.init(coder: aDecoder)
+ }
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ collectionView?.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier:kRZCollectionViewCellReuseId);
+
+// TODO: Currently the RZOverscrollInteractor will take over the collection view's delegate, meaning that ```didSelectItemAtIndexPath:```
+// will not be forwarded back. RZOverscrollInteractor requires a bit of a rewrite to use KVO instead of delegation to address this.
+// self.presentOverscrollInteractor = [[RZOverscrollInteractionController alloc] init];
+// [self.presentOverscrollInteractor attachViewController:self withAction:RZTransitionAction_Present];
+// [self.presentOverscrollInteractor setNextViewControllerDelegate:self];
+// [[RZTransitionsManager shared] setInteractionController:self.presentOverscrollInteractor
+// fromViewController:[self class]
+// toViewController:nil
+// forAction:RZTransitionAction_Present];
+
+ presentDismissAnimationController = RZRectZoomAnimationController()
+ presentDismissAnimationController?.rectZoomDelegate = self
+
+ RZTransitionsManager.shared().setAnimationController( presentDismissAnimationController,
+ fromViewController:self.dynamicType,
+ forAction:.PresentDismiss )
+
+ transitioningDelegate = RZTransitionsManager.shared()
+ }
+
+// - (void)viewDidAppear:(BOOL)animated
+//{
+// [super viewDidAppear:animated];
+// // TODO: ** Cannot set the scroll view delegate and the collection view delegate at the same time **
+// // [self.presentOverscrollInteractor watchScrollView:self.collectionView];
+//}
+
+//MARK: - New VC Helper Methods
+
+ func newColorVCWithColor(color: UIColor?) -> UIViewController {
+ let newColorVC = RZSimpleColorViewController(color: color)
+ newColorVC.transitioningDelegate = RZTransitionsManager.shared()
+
+ // TODO: Hook up next VC's dismiss transition
+ return newColorVC
+ }
+
+//MARK: - UICollectionViewDelegate
+
+ func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath:NSIndexPath) {
+ guard let cell = collectionView.cellForItemAtIndexPath(indexPath) else {
+ fatalError("no cell at \(indexPath)")
+ }
+ let colorVC = newColorVCWithColor(cell.backgroundColor ?? UIColor.clearColor())
+
+ circleTransitionStartPoint = collectionView.convertPoint(cell.center, toView:view)
+ transitionCellRect = collectionView.convertRect(cell.frame, toView:view)
+
+ // Present VC
+ presentViewController(colorVC, animated:true) {}
+ }
+
+//MARK: - UICollectionViewDataSource
+
+ func collectionView(collectionView:UICollectionView, numberOfItemsInSection section:NSInteger) -> NSInteger {
+ return kRZCollectionViewNumCells
+ }
+
+ func collectionView(collectionView:UICollectionView, cellForItemAtIndexPath indexPath:NSIndexPath) -> UICollectionViewCell {
+ let cell = collectionView.dequeueReusableCellWithReuseIdentifier(kRZCollectionViewCellReuseId, forIndexPath:indexPath)
+ cell.backgroundColor = UIColor.randomColor()
+ return cell
+ }
+
+//MARK: - RZTransitionInteractionControllerDelegate
+
+ func nextViewControllerForInteractor() -> UIViewController? {
+ return newColorVCWithColor(nil)
+ }
+
+//MARK: - RZRectZoomAnimationDelegate
+
+ func rectZoomPosition() -> CGRect {
+ return transitionCellRect
+ }
+
+//MARK: - RZCirclePushAnimationDelegate
+
+ func circleCenter() -> CGPoint {
+ return circleTransitionStartPoint;
+ }
+
+ func circleStartingRadius() -> CGFloat {
+ return (kRZCollectionViewCellSize / 2.0);
+ }
+}
\ No newline at end of file
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.xib b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.xib
index 3e28467..3f6fd80 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.xib
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.xib
@@ -1,7 +1,8 @@
-
+
-
+
+
@@ -15,9 +16,8 @@
-
+
-
@@ -34,9 +34,13 @@
-
+
+
+
+
+
+
-
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.swift b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.swift
new file mode 100644
index 0000000..91255eb
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.swift
@@ -0,0 +1,68 @@
+//
+// RZSimpleColorViewController.swift
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/16/15.
+// Copyright © 2015 Raizlabs and other contributors
+// http://raizlabs.com/
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+import Foundation
+import UIKit
+
+@objc(RZSimpleColorViewController)
+final class RZSimpleColorViewController: UIViewController
+{
+ lazy var backgroundColor: UIColor = UIColor.redColor()
+
+ @IBOutlet weak var titleLabel: UILabel?
+
+ override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
+ super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ super.init(coder: aDecoder)
+ }
+
+ init(color: UIColor?) {
+ super.init(nibName: nil, bundle: nil)
+ if (color != nil) {
+ backgroundColor = color!
+ }
+ }
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ view.backgroundColor = backgroundColor
+ let tapGestureRecognizer = UITapGestureRecognizer(target:self, action:"dismissSelfOnTap:")
+ view.addGestureRecognizer(tapGestureRecognizer)
+ }
+
+ //MARK: - Handle Tap Gesture Recognizer
+
+ @objc(dismissSelfOnTap:)
+ func dismissSelfOnTap(tapGestureRecognizer: UITapGestureRecognizer) {
+ dismissViewControllerAnimated(true, completion: nil)
+ }
+
+}
\ No newline at end of file
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.xib b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.xib
index f4f1894..792b9ae 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.xib
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleColorViewController.xib
@@ -1,7 +1,7 @@
-
+
-
+
@@ -17,7 +17,6 @@
-
@@ -30,8 +29,6 @@
-
-
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m
index be22019..cb0440f 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m
@@ -44,6 +44,7 @@ @interface RZSimpleViewController ()
@property (nonatomic, strong) id pushPopInteractionController;
@property (nonatomic, strong) id presentInteractionController;
+@property (nonatomic, strong) id pinchInteractionController;
@end
@@ -69,7 +70,11 @@ - (void)viewDidLoad
self.presentInteractionController = [[RZVerticalSwipeInteractionController alloc] init];
[self.presentInteractionController setNextViewControllerDelegate:self];
[self.presentInteractionController attachViewController:self withAction:RZTransitionAction_Present];
-
+
+ self.pinchInteractionController = [RZPinchInteractionController new];
+ [self.pinchInteractionController setNextViewControllerDelegate:self];
+ [self.pinchInteractionController attachViewController:self withAction:RZTransitionAction_Present];
+
// Setup the push & pop animations as well as a special animation for pushing a
// RZSimpleCollectionViewController
[[RZTransitionsManager shared] setAnimationController:[[RZCardSlideAnimationController alloc] init]
@@ -93,6 +98,10 @@ - (void)viewWillAppear:(BOOL)animated
fromViewController:[self class]
toViewController:nil
forAction:RZTransitionAction_Present];
+ [[RZTransitionsManager shared] setInteractionController:self.pinchInteractionController
+ fromViewController:[self class]
+ toViewController:nil
+ forAction:RZTransitionAction_Present];
}
#pragma mark - Button Actions
@@ -148,6 +157,9 @@ - (UIViewController *)nextViewControllerForInteractor:(id UIViewController {
+ let newVC = RZSimpleViewController()
+ newVC.transitioningDelegate = RZTransitionsManager.shared()
+ return newVC;
+ }
+
+ func nextSimpleColorViewController() -> UIViewController {
+ let newColorVC = RZSimpleColorViewController()
+ newColorVC.transitioningDelegate = RZTransitionsManager.shared()
+
+ // Create a dismiss interaction controller that will be attached to the presented
+ // view controller to allow for a custom dismissal
+ let dismissInteractionController = RZVerticalSwipeInteractionController()
+ dismissInteractionController.attachViewController(newColorVC, withAction:.Dismiss)
+ RZTransitionsManager.shared().setInteractionController(dismissInteractionController,
+ fromViewController:self.dynamicType,
+ toViewController:nil,
+ forAction:.Dismiss)
+ return newColorVC
+ }
+
+ func nextViewControllerForInteractor(interactor: RZTransitionInteractionController) -> UIViewController {
+ if (interactor is RZVerticalSwipeInteractionController) {
+ return nextSimpleColorViewController();
+ }
+ else {
+ return nextSimpleViewController();
+ }
+ }
+
+}
diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.xib b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.xib
index 8aff90d..f5d1700 100644
--- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.xib
+++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.xib
@@ -1,7 +1,8 @@
-
+
-
+
+
@@ -19,8 +20,7 @@
-
-
+
@@ -29,8 +29,7 @@
-
-
+
@@ -40,7 +39,6 @@
-
@@ -52,8 +50,7 @@
-
-
+
@@ -62,8 +59,7 @@
-
-
+
@@ -89,9 +85,7 @@
-
-
diff --git a/RZTransitions-Demo/RZTransitions-Demo/en.lproj/Launch Screen.xib b/RZTransitions-Demo/RZTransitions-Demo/en.lproj/Launch Screen.xib
new file mode 100644
index 0000000..22802ed
--- /dev/null
+++ b/RZTransitions-Demo/RZTransitions-Demo/en.lproj/Launch Screen.xib
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RZTransitions-Demo/RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist b/RZTransitions-Demo/RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist
index fa2bd94..169b6f7 100644
--- a/RZTransitions-Demo/RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist
+++ b/RZTransitions-Demo/RZTransitions-DemoTests/RZTransitions-DemoTests-Info.plist
@@ -7,7 +7,7 @@
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
- com.raizlabs.${PRODUCT_NAME:rfc1034identifier}
+ $(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundlePackageType
diff --git a/RZTransitions-Demo/ReadMeSnippets.m b/RZTransitions-Demo/ReadMeSnippets.m
new file mode 100644
index 0000000..488cd93
--- /dev/null
+++ b/RZTransitions-Demo/ReadMeSnippets.m
@@ -0,0 +1,71 @@
+//
+// ReadMeSnippets.m
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/24/15.
+// Copyright © 2015 Raizlabs. All rights reserved.
+//
+
+#import "RZTransitions.h"
+#import "RZSimpleCollectionViewController.h"
+
+@interface ReadMeSnippets : UIViewController
+
+// 5
+@property (nonatomic, strong) id presentInteractionController;
+
+@end
+
+@implementation ReadMeSnippets
+
+-(void)snippets
+{
+ // 1
+ id presentDismissAnimationController = [[RZZoomAlphaAnimationController alloc] init];
+ id pushPopAnimationController = [[RZCardSlideAnimationController alloc] init];
+ [[RZTransitionsManager shared] setDefaultPresentDismissAnimationController:presentDismissAnimationController];
+ [[RZTransitionsManager shared] setDefaultPushPopAnimationController:pushPopAnimationController];
+
+ // 2
+ [self setTransitioningDelegate:[RZTransitionsManager shared]];
+ UIViewController *nextViewController = [[UIViewController alloc] init];
+ [nextViewController setTransitioningDelegate:[RZTransitionsManager shared]];
+ [self presentViewController:nextViewController animated:YES completion:nil];
+
+ // 3
+ UINavigationController *navigationController = [[UINavigationController alloc] init];
+ [navigationController setDelegate:[RZTransitionsManager shared]];
+
+ // 4
+ [[RZTransitionsManager shared] setAnimationController:[[RZZoomPushAnimationController alloc] init]
+ fromViewController:[self class]
+ toViewController:[RZSimpleCollectionViewController class]
+ forAction:RZTransitionAction_PushPop];
+
+}
+
+// 5
+//@property (nonatomic, strong) id presentInteractionController;
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Create the presentation interaction controller that allows a custom gesture
+ // to control presenting a new VC via a presentViewController
+ self.presentInteractionController = [[RZVerticalSwipeInteractionController alloc] init];
+ [self.presentInteractionController setNextViewControllerDelegate:self];
+ [self.presentInteractionController attachViewController:self withAction:RZTransitionAction_Present];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+ // Use the present interaction controller for presenting any view controller from this view controller
+ [[RZTransitionsManager shared] setInteractionController:self.presentInteractionController
+ fromViewController:[self class]
+ toViewController:nil
+ forAction:RZTransitionAction_Present];
+}
+// end of 5
+
+@end
diff --git a/RZTransitions-Demo/ReadMeSnippets.swift b/RZTransitions-Demo/ReadMeSnippets.swift
new file mode 100644
index 0000000..19cbe20
--- /dev/null
+++ b/RZTransitions-Demo/ReadMeSnippets.swift
@@ -0,0 +1,67 @@
+//
+// ReadMeSnippets.swift
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/24/15.
+// Copyright © 2015 Raizlabs. All rights reserved.
+//
+
+import UIKit
+
+class Foo : UIViewController, RZTransitionInteractionControllerDelegate
+{
+ //5
+ var presentInteractionController : RZTransitionInteractionController?
+
+ override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
+ super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ super.init(coder: aDecoder)
+ }
+
+ func snippets()
+ {
+ // 1
+ RZTransitionsManager.shared().defaultPresentDismissAnimationController = RZZoomAlphaAnimationController()
+ RZTransitionsManager.shared().defaultPushPopAnimationController = RZCardSlideAnimationController()
+
+ // 2
+ self.transitioningDelegate = RZTransitionsManager.shared()
+ let nextViewController = UIViewController()
+ nextViewController.transitioningDelegate = RZTransitionsManager.shared()
+ self.presentViewController(nextViewController, animated:true) {}
+
+
+ // 3
+ let navigationController = UINavigationController()
+ navigationController.delegate = RZTransitionsManager.shared()
+
+ // 4
+ RZTransitionsManager.shared().setAnimationController( RZZoomPushAnimationController(),
+ fromViewController:self.dynamicType,
+ toViewController:RZSimpleCollectionViewController.self,
+ forAction:.PushPop)
+ }
+ // 5
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ self.presentInteractionController = RZVerticalSwipeInteractionController()
+ if let vc = self.presentInteractionController as? RZVerticalSwipeInteractionController {
+ vc.nextViewControllerDelegate = self
+ vc.attachViewController(self, withAction:.Present)
+ }
+ }
+
+ override func viewWillAppear(animated: Bool) {
+ super.viewWillAppear(animated)
+ RZTransitionsManager.shared().setInteractionController( self.presentInteractionController,
+ fromViewController:self.dynamicType,
+ toViewController:nil,
+ forAction:.Present)
+ }
+
+
+}
diff --git a/RZTransitions.podspec b/RZTransitions.podspec
index d46ec70..d853c8d 100644
--- a/RZTransitions.podspec
+++ b/RZTransitions.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RZTransitions"
- s.version = "1.1.1"
+ s.version = "1.2"
s.summary = "RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple."
s.description = <<-DESC
@@ -19,8 +19,8 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/raizlabs"
s.platform = :ios, "7.0"
- s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.1.1" }
- s.source_files = "RZTransitions/**/*.{h,m}"
+ s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.2" }
+ s.source_files = "RZTransitions/**/*.{h,m,swift}"
s.frameworks = "CoreGraphics", "UIKit", "Foundation"
s.requires_arc = true
diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h
index c872189..f497138 100644
--- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h
+++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h
@@ -37,7 +37,7 @@
/**
* The ViewController that is doing the presenting.
*/
-@property (strong, nonatomic) UIViewController *fromViewController;
+@property (weak, nonatomic) UIViewController *fromViewController;
/**
* The GestureRecognizer to get information about the swipe.
diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m
index 4e88392..9911069 100644
--- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m
+++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m
@@ -91,9 +91,13 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer
}
else {
if ( self.action & RZTransitionAction_Pop ) {
+ [self cancelInteractiveTransition];
+ self.isInteractive = NO;
[self.fromViewController.navigationController popViewControllerAnimated:YES];
}
else if ( self.action & RZTransitionAction_Dismiss ) {
+ [self cancelInteractiveTransition];
+ self.isInteractive = NO;
[self.fromViewController dismissViewControllerAnimated:YES completion:nil];
}
}
@@ -101,7 +105,7 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer
case UIGestureRecognizerStateChanged:
if ( self.isInteractive ) {
- self.shouldCompleteTransition = ( percentage > [self swipeCompletionPercent] );
+ self.shouldCompleteTransition = ( percentage >= [self swipeCompletionPercent] );
[self updateInteractiveTransition:percentage];
}
break;
diff --git a/RZTransitions/Interactors/RZPinchInteractionController.h b/RZTransitions/Interactors/RZPinchInteractionController.h
index 4bd3b60..902fe20 100644
--- a/RZTransitions/Interactors/RZPinchInteractionController.h
+++ b/RZTransitions/Interactors/RZPinchInteractionController.h
@@ -38,7 +38,7 @@
/**
* The View Controller that is being transitioned from.
*/
-@property (strong, nonatomic) UIViewController *fromViewController;
+@property (weak, nonatomic) UIViewController *fromViewController;
/**
* The Pinch Gesture recognizer that is used to control the interaction
diff --git a/RZTransitions/Interactors/RZPinchInteractionController.m b/RZTransitions/Interactors/RZPinchInteractionController.m
index d8438ca..edcb27c 100644
--- a/RZTransitions/Interactors/RZPinchInteractionController.m
+++ b/RZTransitions/Interactors/RZPinchInteractionController.m
@@ -91,9 +91,13 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinchGestureRecognizer
}
else {
if ( self.action & RZTransitionAction_Pop ) {
+ [self cancelInteractiveTransition];
+ self.isInteractive = NO;
[self.fromViewController.navigationController popViewControllerAnimated:YES];
}
else if ( self.action & RZTransitionAction_Dismiss ) {
+ [self cancelInteractiveTransition];
+ self.isInteractive = NO;
[self.fromViewController dismissViewControllerAnimated:YES completion:nil];
}
}
diff --git a/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h b/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h
index bb01c25..f1378c4 100644
--- a/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h
+++ b/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h
@@ -33,7 +33,6 @@
#define RZTransitions_RZTransitionInteractorProtocol_h
@protocol RZTransitionInteractionController;
-@protocol RZTransitionInteractionControllerDelegate;
@protocol RZTransitionInteractionControllerDelegate
diff --git a/RZTransitions/Managers/RZTransitionsManager.h b/RZTransitions/Managers/RZTransitionsManager.h
index 3d71977..f925518 100644
--- a/RZTransitions/Managers/RZTransitionsManager.h
+++ b/RZTransitions/Managers/RZTransitionsManager.h
@@ -41,21 +41,21 @@
/**
* The default animation to use when pushing or popping a @c UIViewController on a @c UINavigationController. Uses nothing if nil.
*/
-@property (strong, nonatomic) id defaultPushPopAnimationController;
+@property (strong, nonatomic) id _Nullable defaultPushPopAnimationController;
/**
* The default animation to use when presenting or dismissing a @c UIViewController on a @c UIViewController. Uses nothing if nil.
*/
-@property (strong, nonatomic) id defaultPresentDismissAnimationController;
+@property (strong, nonatomic) id _Nullable defaultPresentDismissAnimationController;
/**
* The default animation to use when moving between tabs on a @c UITabBarController. Uses nothing if nil.
*/
-@property (strong, nonatomic) id defaultTabBarAnimationController;
+@property (strong, nonatomic) id _Nullable defaultTabBarAnimationController;
#pragma mark - Shared Instance
-+ (RZTransitionsManager *)shared;
++ (RZTransitionsManager *_Nonnull)shared;
#pragma mark - Public API Set Animations and Interactions
@@ -68,8 +68,8 @@
*
* @return A unique key object that can be used to reference this animation pairing.
*/
-- (RZUniqueTransition *)setAnimationController:(id)animationController
- fromViewController:(Class)fromViewController
+- (RZUniqueTransition * _Nonnull)setAnimationController:(id _Nullable)animationController
+ fromViewController:(Class _Nonnull )fromViewController
forAction:(RZTransitionAction)action;
/**
@@ -82,9 +82,9 @@
*
* @return A unique key object that can be used to reference this animation pairing.
*/
-- (RZUniqueTransition *)setAnimationController:(id)animationController
- fromViewController:(Class)fromViewController
- toViewController:(Class)toViewController
+- (RZUniqueTransition * _Nonnull )setAnimationController:(id _Nullable)animationController
+ fromViewController:(Class _Nullable )fromViewController
+ toViewController:(Class _Nullable )toViewController
forAction:(RZTransitionAction)action;
/**
@@ -97,9 +97,9 @@
*
* @return A unique key object that can be used to reference this interaction pairing.
*/
-- (RZUniqueTransition *)setInteractionController:(id)interactionController
- fromViewController:(Class)fromViewController
- toViewController:(Class)toViewController
+- (RZUniqueTransition * _Nonnull )setInteractionController:(id _Nullable)interactionController
+ fromViewController:(Class _Nullable )fromViewController
+ toViewController:(Class _Nullable )toViewController
forAction:(RZTransitionAction)action;
/**
@@ -108,6 +108,6 @@
* @param override Override if @c YES, ignore if @c NO.
* @param transitionKey The unique key for the animation / view controller pairing to override.
*/
-- (void)overrideAnimationDirection:(BOOL)override withTransition:(RZUniqueTransition *)transitionKey;
+- (void)overrideAnimationDirection:(BOOL)override withTransition:(RZUniqueTransition * _Nonnull)transitionKey;
@end
diff --git a/RZTransitions/Managers/RZTransitionsManager.m b/RZTransitions/Managers/RZTransitionsManager.m
index 8d446df..5d09cf4 100644
--- a/RZTransitions/Managers/RZTransitionsManager.m
+++ b/RZTransitions/Managers/RZTransitionsManager.m
@@ -85,7 +85,7 @@ - (RZUniqueTransition *)setAnimationController:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
UIView *container = [transitionContext containerView];
-
+
UIView *bgView = [[UIView alloc] initWithFrame:container.bounds];
bgView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
bgView.backgroundColor = self.containerBackgroundColor;
[container insertSubview:bgView atIndex:0];
-
+
if ( self.isPositiveAnimation ) {
- [container insertSubview:toViewController.view belowSubview:fromViewController.view];
- toViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZSlideScaleChangePct, 1.0 - kRZSlideScaleChangePct);
- toViewController.view.alpha = 0.1f;
-
+ [container insertSubview:toView belowSubview:fromView];
+ toView.frame = container.frame;
+ toView.transform = CGAffineTransformMakeScale(1.0 - kRZSlideScaleChangePct, 1.0 - kRZSlideScaleChangePct);
+ toView.alpha = 0.1f;
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
- toViewController.view.transform = CGAffineTransformIdentity;
- toViewController.view.alpha = 1.0f;
+ toView.transform = CGAffineTransformIdentity;
+ toView.alpha = 1.0f;
if ( self.horizontalOrientation ) {
- fromViewController.view.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0);
+ fromView.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0);
}
else {
- fromViewController.view.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height);
+ fromView.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height);
}
}
completion:^(BOOL finished) {
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformIdentity;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformIdentity;
[bgView removeFromSuperview];
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
else {
- [container addSubview:toViewController.view];
-
+ [container addSubview:toView];
+
if ( self.horizontalOrientation ) {
- toViewController.view.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0);
+ toView.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0);
}
else {
- toViewController.view.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height);
+ toView.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height);
}
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZSlideScaleChangePct, 1.0 - kRZSlideScaleChangePct);
- fromViewController.view.alpha = 0.1f;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformMakeScale(1.0 - kRZSlideScaleChangePct, 1.0 - kRZSlideScaleChangePct);
+ fromView.alpha = 0.1f;
}
completion:^(BOOL finished) {
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.alpha = 1.0f;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformIdentity;
+ fromView.alpha = 1.0f;
[bgView removeFromSuperview];
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
diff --git a/RZTransitions/Transitions/RZCirclePushAnimationController.m b/RZTransitions/Transitions/RZCirclePushAnimationController.m
index 3711139..247fc09 100644
--- a/RZTransitions/Transitions/RZCirclePushAnimationController.m
+++ b/RZTransitions/Transitions/RZCirclePushAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZCirclePushAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
#define kRZCircleDefaultMaxScale 2.5f
@@ -36,9 +37,8 @@
@interface RZCirclePushAnimationController ()
-- (CGPoint)circleCenterPointWithFromViewController:(UIViewController *)fromViewController;
-- (CGFloat)circleStartingRadiusWithFromViewController:(UIViewController *)fromViewController
- withToViewController:(UIViewController *)toViewController;
+- (CGPoint)circleCenterPointWithFromView:(UIView *)fromView;
+- (CGFloat)circleStartingRadiusWithFromView:(UIView *)fromView toView:(UIView *)toView;
@end
@@ -60,18 +60,18 @@ - (instancetype)init
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
-
- CGRect bounds = toViewController.view.bounds;
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
+
+ CGRect bounds = fromView.bounds;
CAShapeLayer *circleMaskLayer = [CAShapeLayer layer];
circleMaskLayer.frame = bounds;
- // Caclulate the size the circle should start at
- CGFloat radius = [self circleStartingRadiusWithFromViewController:fromViewController withToViewController:toViewController];
+ // Calculate the size the circle should start at
+ CGFloat radius = [self circleStartingRadiusWithFromView:fromView toView:toView];
- // Caclulate the center point of the circle
- CGPoint circleCenter = [self circleCenterPointWithFromViewController:fromViewController];
+ // Calculate the center point of the circle
+ CGPoint circleCenter = [self circleCenterPointWithFromView:fromView];
circleMaskLayer.position = circleCenter;
CGRect circleBoundingRect = CGRectMake(circleCenter.x - radius, circleCenter.y - radius, 2.0*radius, 2.0*radius);
circleMaskLayer.path = [UIBezierPath bezierPathWithOvalInRect:circleBoundingRect].CGPath;
@@ -93,8 +93,8 @@ - (void)animateTransition:(id)transitionCo
circleMaskAnimation.toValue = @(self.maximumCircleScale);
// Add to the view and start the animation
- toViewController.view.layer.mask = circleMaskLayer;
- toViewController.view.layer.masksToBounds = YES;
+ toView.layer.mask = circleMaskLayer;
+ toView.layer.masksToBounds = YES;
[circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation];
}
else {
@@ -105,8 +105,8 @@ - (void)animateTransition:(id)transitionCo
circleMaskAnimation.toValue = @(self.minimumCircleScale);
// Add to the view and start the animation
- fromViewController.view.layer.mask = circleMaskLayer;
- fromViewController.view.layer.masksToBounds = YES;
+ fromView.layer.mask = circleMaskLayer;
+ fromView.layer.masksToBounds = YES;
[circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation];
}
@@ -115,32 +115,31 @@ - (void)animateTransition:(id)transitionCo
#pragma mark - Helper Methods
-// Caclulate the center point of the circle
-- (CGPoint)circleCenterPointWithFromViewController:(UIViewController *)fromViewController
+// Calculate the center point of the circle
+- (CGPoint)circleCenterPointWithFromView:(UIView *)fromView
{
CGPoint center = CGPointZero;
if ( self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleCenter)] ) {
center = [self.circleDelegate circleCenter];
}
else {
- center = CGPointMake(fromViewController.view.bounds.origin.x + fromViewController.view.bounds.size.width / 2,
- fromViewController.view.bounds.origin.y + fromViewController.view.bounds.size.height / 2);
+ center = CGPointMake(fromView.bounds.origin.x + fromView.bounds.size.width / 2,
+ fromView.bounds.origin.y + fromView.bounds.size.height / 2);
}
return center;
}
-// Caclulate the size the circle should start at
-- (CGFloat)circleStartingRadiusWithFromViewController:(UIViewController *)fromViewController
- withToViewController:(UIViewController *)toViewController
+// Calculate the size the circle should start at
+- (CGFloat)circleStartingRadiusWithFromView:(UIView *)fromView toView:(UIView *)toView
{
CGFloat radius = 0.0f;
if ( self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleStartingRadius)] ) {
radius = [self.circleDelegate circleStartingRadius];
- CGRect bounds = toViewController.view.bounds;
+ CGRect bounds = toView.bounds;
self.maximumCircleScale = ((MAX(bounds.size.height, bounds.size.width) / (radius)) * 1.25);
}
else {
- CGRect bounds = fromViewController.view.bounds;
+ CGRect bounds = fromView.bounds;
CGFloat diameter = MIN(bounds.size.height, bounds.size.width);
radius = diameter / 2;
}
diff --git a/RZTransitions/Transitions/RZRectZoomAnimationController.m b/RZTransitions/Transitions/RZRectZoomAnimationController.m
index c24973f..0710244 100644
--- a/RZTransitions/Transitions/RZRectZoomAnimationController.m
+++ b/RZTransitions/Transitions/RZRectZoomAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZRectZoomAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
static const CGFloat kRZRectZoomAnimationTime = 0.7f;
@@ -54,11 +55,11 @@ - (instancetype)init
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
UIView *container = [transitionContext containerView];
- CGRect originalFrame = toViewController.view.frame;
+ CGRect originalFrame = fromView.frame;
CGRect cellFrame = CGRectZero;
if ( [self.rectZoomDelegate respondsToSelector:@selector(rectZoomPosition)] ) {
@@ -66,13 +67,14 @@ - (void)animateTransition:(id)transitionCo
}
if ( self.isPositiveAnimation ) {
- UIView *resizableSnapshotView = [toViewController.view resizableSnapshotViewFromRect:toViewController.view.bounds afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
+ toView.frame = fromView.frame;
+ UIView *resizableSnapshotView = [toView resizableSnapshotViewFromRect:toView.bounds afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
resizableSnapshotView.frame = cellFrame;
[container addSubview:resizableSnapshotView];
[UIView animateWithDuration:kRZRectZoomDefaultFadeAnimationTime animations:^{
if ( self.shouldFadeBackgroundViewController ) {
- fromViewController.view.alpha = 0.0f;
+ fromView.alpha = 0.0f;
}
}];
@@ -84,28 +86,25 @@ - (void)animateTransition:(id)transitionCo
animations:^{
resizableSnapshotView.frame = originalFrame;
} completion:^(BOOL finished) {
- [container addSubview:toViewController.view];
+ [container addSubview:toView];
[resizableSnapshotView removeFromSuperview];
if ( self.shouldFadeBackgroundViewController ) {
- fromViewController.view.alpha = 1.0f;
+ fromView.alpha = 1.0f;
}
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
else {
- UIView *resizableSnapshotView = [fromViewController.view resizableSnapshotViewFromRect:fromViewController.view.bounds afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
- resizableSnapshotView.frame = fromViewController.view.frame;
+ UIView *resizableSnapshotView = [fromView resizableSnapshotViewFromRect:fromView.bounds afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
+ resizableSnapshotView.frame = fromView.frame;
- [container insertSubview:resizableSnapshotView aboveSubview:fromViewController.view];
- [container insertSubview:toViewController.view belowSubview:resizableSnapshotView];
+ [container insertSubview:resizableSnapshotView aboveSubview:fromView];
+ [container insertSubview:toView belowSubview:resizableSnapshotView];
- toViewController.view.alpha = 0.0f;
+ toView.alpha = 0.0f;
- //! TODO: no... We need to fix this. Figure out who needed this line, do it right, then test.
- [toViewController viewWillAppear:YES];
-
[UIView animateWithDuration:kRZRectZoomDefaultFadeAnimationTime animations:^{
- toViewController.view.alpha = 1.0f;
+ toView.alpha = 1.0f;
}];
[UIView animateWithDuration:kRZRectZoomAnimationTime
@@ -120,7 +119,7 @@ - (void)animateTransition:(id)transitionCo
resizableSnapshotView.alpha = 0.0f;
} completion:^(BOOL finished) {
[resizableSnapshotView removeFromSuperview];
- [container addSubview:fromViewController.view];
+ [container addSubview:fromView];
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}];
diff --git a/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m b/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m
index 75e46fe..314d338 100644
--- a/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m
+++ b/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZSegmentControlMoveFadeAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
#import "UIImage+RZTransitionsFastImageBlur.h"
@@ -42,8 +43,8 @@ @implementation RZSegmentControlMoveFadeAnimationController
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
UIView *container = [transitionContext containerView];
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(kRZSegScaleAmount, kRZSegScaleAmount);
@@ -60,17 +61,17 @@ - (void)animateTransition:(id)transitionCo
newTranslateTransform = CGAffineTransformMakeTranslation(container.bounds.size.width*kRZSegXOffsetFactor, -container.bounds.size.height*kRZSegYOffsetFactor);
}
- [container insertSubview:toViewController.view aboveSubview:fromViewController.view];
- toViewController.view.alpha = 0.1f;
- toViewController.view.transform = CGAffineTransformConcat(newTranslateTransform, scaleTransform);
+ [container insertSubview:toView aboveSubview:fromView];
+ toView.alpha = 0.1f;
+ toView.transform = CGAffineTransformConcat(newTranslateTransform, scaleTransform);
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
- toViewController.view.transform = CGAffineTransformIdentity;
- toViewController.view.alpha = 1.0f;
- fromViewController.view.transform = CGAffineTransformConcat(oldTranslateTransform, scaleTransform);
- fromViewController.view.alpha = 0.1f;
+ fromView.transform = CGAffineTransformIdentity;
+ fromView.alpha = 1.0f;
+ fromView.transform = CGAffineTransformConcat(oldTranslateTransform, scaleTransform);
+ fromView.alpha = 0.1f;
}
completion:^(BOOL finished) {
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
diff --git a/RZTransitions/Transitions/RZShrinkZoomAnimationController.m b/RZTransitions/Transitions/RZShrinkZoomAnimationController.m
index ba2939a..6f34c89 100644
--- a/RZTransitions/Transitions/RZShrinkZoomAnimationController.m
+++ b/RZTransitions/Transitions/RZShrinkZoomAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZShrinkZoomAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
@implementation RZShrinkZoomAnimationController
@@ -35,20 +36,20 @@ @implementation RZShrinkZoomAnimationController
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
UIView *container = [transitionContext containerView];
[UIView animateWithDuration:0.5 delay:0 options:0 animations:^{
- [fromViewController.view setTransform:CGAffineTransformMakeScale(0.1, 0.1)];
+ [fromView setTransform:CGAffineTransformMakeScale(0.1, 0.1)];
} completion:^(BOOL finished) {
- [fromViewController.view removeFromSuperview];
- [toViewController.view setTransform:CGAffineTransformMakeScale(0.1, 0.1)];
- [container addSubview:toViewController.view];
+ [fromView removeFromSuperview];
+ [toView setTransform:CGAffineTransformMakeScale(0.1, 0.1)];
+ [container addSubview:toView];
[UIView animateWithDuration:0.5 delay:0 options:0 animations:^{
- [toViewController.view setTransform:CGAffineTransformIdentity];
+ [fromView setTransform:CGAffineTransformIdentity];
} completion:^(BOOL finished) {
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
diff --git a/RZTransitions/Transitions/RZZoomAlphaAnimationController.m b/RZTransitions/Transitions/RZZoomAlphaAnimationController.m
index ac04de0..d763fdf 100644
--- a/RZTransitions/Transitions/RZZoomAlphaAnimationController.m
+++ b/RZTransitions/Transitions/RZZoomAlphaAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZZoomAlphaAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
#define kRZZoomAlphaTransitionTime 0.3
@@ -40,44 +41,44 @@ @implementation RZZoomAlphaAnimationController
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
UIView *container = [transitionContext containerView];
- toViewController.view.userInteractionEnabled = YES;
+ toView.userInteractionEnabled = YES;
if ( !self.isPositiveAnimation ) {
- fromViewController.view.opaque = NO;
- [container insertSubview:toViewController.view belowSubview:fromViewController.view];
+ fromView.opaque = NO;
+ [container insertSubview:toView belowSubview:fromView];
[UIView animateWithDuration:kRZZoomAlphaTransitionTime
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
- fromViewController.view.alpha = 0.0f;
- fromViewController.view.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale);
+ fromView.alpha = 0.0f;
+ fromView.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale);
}
completion:^(BOOL finished) {
- fromViewController.view.alpha = 1.0f;
- fromViewController.view.transform = CGAffineTransformIdentity;
+ fromView.alpha = 1.0f;
+ fromView.transform = CGAffineTransformIdentity;
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
else {
- toViewController.view.opaque = NO;
- toViewController.view.alpha = 0.0f;
- toViewController.view.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale);
- [container addSubview:toViewController.view];
+ toView.opaque = NO;
+ toView.alpha = 0.0f;
+ toView.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale);
+ [container addSubview:toView];
[UIView animateWithDuration:kRZZoomAlphaTransitionTime
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
- toViewController.view.alpha = 1.0f;
- toViewController.view.transform = CGAffineTransformIdentity;
+ toView.alpha = 1.0f;
+ toView.transform = CGAffineTransformIdentity;
}
completion:^(BOOL finished) {
- toViewController.view.opaque = YES;
+ toView.opaque = YES;
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.m b/RZTransitions/Transitions/RZZoomBlurAnimationController.m
index f10d691..cca6873 100644
--- a/RZTransitions/Transitions/RZZoomBlurAnimationController.m
+++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.m
@@ -27,6 +27,8 @@
//
#import "RZZoomBlurAnimationController.h"
+
+#import "NSObject+RZTransitionsViewHelpers.h"
#import "UIImage+RZTransitionsFastImageBlur.h"
#import
@@ -36,22 +38,37 @@
#define kRZZBDefaultBlurRadius 12.0f
#define kRZZBDefaultSaturationDelta 1.0f
#define kRZZBDefaultTintColor [UIColor colorWithWhite:1.0f alpha:0.15f]
-
static char kRZZoomBlurImageAssocKey;
@implementation RZZoomBlurAnimationController
@synthesize isPositiveAnimation = _isPositiveAnimation;
-- (instancetype)init
+- (CGFloat)blurRadius
{
- self = [super init];
- if ( self ) {
+ if (_blurRadius == 0)
+ {
_blurRadius = kRZZBDefaultBlurRadius;
+ }
+ return _blurRadius;
+}
+
+- (CGFloat)saturationDelta
+{
+ if (_saturationDelta == 0)
+ {
_saturationDelta = kRZZBDefaultSaturationDelta;
+ }
+ return _saturationDelta;
+}
+
+- (UIColor *)blurTintColor
+{
+ if (!_blurTintColor)
+ {
_blurTintColor = kRZZBDefaultTintColor;
}
- return self;
+ return _blurTintColor;
}
#pragma mark - Animated transitioning
@@ -61,19 +78,24 @@ - (void)animateTransition:(id)transitionCo
UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIView *container = [transitionContext containerView];
-
- toViewController.view.userInteractionEnabled = YES;
-
- if ( !self.isPositiveAnimation ) {
+
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
+
+ toView.userInteractionEnabled = YES;
+
+ if (!self.isPositiveAnimation)
+ {
// This may not exist if we didn't present with this guy originally. If not, it will just do an alpha fade, no blur.
UIImageView *blurImageView = objc_getAssociatedObject(fromViewController, &kRZZoomBlurImageAssocKey);
-
- fromViewController.view.backgroundColor = [UIColor clearColor];
- fromViewController.view.opaque = NO;
- [container insertSubview:toViewController.view belowSubview:fromViewController.view];
-
- if ( blurImageView ) {
- [container insertSubview:blurImageView aboveSubview:toViewController.view];
+
+ fromView.backgroundColor = [UIColor clearColor];
+ fromView.opaque = NO;
+ [container insertSubview:toView belowSubview:fromView];
+
+ if (blurImageView)
+ {
+ [container insertSubview:blurImageView aboveSubview:toView];
}
[UIView animateWithDuration:kRZZBAnimationTransitionTime
@@ -81,45 +103,46 @@ - (void)animateTransition:(id)transitionCo
options:UIViewAnimationOptionCurveEaseOut
animations:^{
blurImageView.alpha = 0.f;
- fromViewController.view.alpha = 0.f;
- fromViewController.view.transform = CGAffineTransformMakeScale(kRZZBZoomScale, kRZZBZoomScale);
+ fromView.alpha = 0.f;
+ fromView.transform = CGAffineTransformMakeScale(kRZZBZoomScale, kRZZBZoomScale);
}
completion:^(BOOL finished) {
- fromViewController.view.alpha = 1.f;
- fromViewController.view.transform = CGAffineTransformIdentity;
+ fromView.alpha = 1.f;
+ fromView.transform = CGAffineTransformIdentity;
[blurImageView removeFromSuperview];
objc_setAssociatedObject(fromViewController, &kRZZoomBlurImageAssocKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
- else {
- UIImage *blurImage = [UIImage blurredImageByCapturingView:fromViewController.view withRadius:self.blurRadius tintColor:self.blurTintColor saturationDeltaFactor:self.saturationDelta];
+ else
+ {
+ UIImage *blurImage = [UIImage blurredImageByCapturingView:fromView withRadius:self.blurRadius tintColor:self.blurTintColor saturationDeltaFactor:self.saturationDelta];
UIImageView *blurImageView = [[UIImageView alloc] initWithImage:blurImage];
objc_setAssociatedObject(toViewController, &kRZZoomBlurImageAssocKey, blurImageView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-
+
[container addSubview:blurImageView];
blurImageView.alpha = 0.f;
-
- UIColor *originalBGColor = [toViewController.view backgroundColor];
- toViewController.view.frame = fromViewController.view.frame;
- toViewController.view.backgroundColor = [UIColor clearColor];
- toViewController.view.opaque = NO;
- toViewController.view.alpha = 0.f;
- toViewController.view.transform = CGAffineTransformMakeScale(kRZZBZoomScale, kRZZBZoomScale);
- [container addSubview:toViewController.view];
-
+
+ UIColor *originalBGColor = [toView backgroundColor];
+ toView.frame = fromView.frame;
+ toView.backgroundColor = [UIColor clearColor];
+ toView.opaque = NO;
+ toView.alpha = 0.f;
+ toView.transform = CGAffineTransformMakeScale(kRZZBZoomScale, kRZZBZoomScale);
+ [container addSubview:toView];
+
[UIView animateWithDuration:kRZZBAnimationTransitionTime
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
blurImageView.alpha = 1.f;
- toViewController.view.alpha = 1.f;
- toViewController.view.transform = CGAffineTransformIdentity;
+ toView.alpha = 1.f;
+ toView.transform = CGAffineTransformIdentity;
}
completion:^(BOOL finished) {
- toViewController.view.backgroundColor = originalBGColor;
- toViewController.view.opaque = YES;
- [toViewController.view insertSubview:blurImageView atIndex:0];
+ toView.backgroundColor = originalBGColor;
+ toView.opaque = YES;
+ [toView insertSubview:blurImageView atIndex:0];
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
diff --git a/RZTransitions/Transitions/RZZoomPushAnimationController.m b/RZTransitions/Transitions/RZZoomPushAnimationController.m
index b307c23..a2129d6 100644
--- a/RZTransitions/Transitions/RZZoomPushAnimationController.m
+++ b/RZTransitions/Transitions/RZZoomPushAnimationController.m
@@ -27,6 +27,7 @@
//
#import "RZZoomPushAnimationController.h"
+#import "NSObject+RZTransitionsViewHelpers.h"
#import
#define kRZPushTransitionTime 0.35
@@ -38,49 +39,50 @@ @implementation RZZoomPushAnimationController
- (void)animateTransition:(id)transitionContext
{
- UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
- UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+ UIView *toView = [(NSObject *)transitionContext rzt_toView];
+ UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
UIView *container = [transitionContext containerView];
if ( self.isPositiveAnimation ) {
- [container insertSubview:toViewController.view belowSubview:fromViewController.view];
- toViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct);
+ toView.frame = container.frame;
+ [container insertSubview:toView belowSubview:fromView];
+ toView.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct);
- //! TODO: We shouldn't really call viewWillAppear here.
- [toViewController viewWillAppear:YES];
[UIView animateWithDuration:kRZPushTransitionTime
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct);
- fromViewController.view.alpha = 0.0f;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct);
+ fromView.alpha = 0.0f;
}
completion:^(BOOL finished) {
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.alpha = 1.0f;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformIdentity;
+ fromView.alpha = 1.0f;
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
else {
- [container addSubview:toViewController.view];
- toViewController.view.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct);
- toViewController.view.alpha = 0.0f;
+ if (transitionContext.presentationStyle == UIModalPresentationNone) {
+ [container insertSubview:toView belowSubview:fromView];
+ }
+ toView.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct);
+ toView.alpha = 0.0f;
- [toViewController viewWillAppear:YES];
[UIView animateWithDuration:kRZPushTransitionTime
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
- toViewController.view.transform = CGAffineTransformIdentity;
- toViewController.view.alpha = 1.0f;
- fromViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct);
+ toView.transform = CGAffineTransformIdentity;
+ toView.alpha = 1.0f;
+ fromView.alpha = 0.0f;
+ fromView.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct);
}
completion:^(BOOL finished) {
- toViewController.view.transform = CGAffineTransformIdentity;
- fromViewController.view.transform = CGAffineTransformIdentity;
- toViewController.view.alpha = 1.0f;
+ toView.transform = CGAffineTransformIdentity;
+ fromView.transform = CGAffineTransformIdentity;
+ toView.alpha = 1.0f;
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
}];
}
diff --git a/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.h b/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.h
new file mode 100644
index 0000000..683a87d
--- /dev/null
+++ b/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.h
@@ -0,0 +1,16 @@
+//
+// NSObject+RZTransitionsViewHelpers.h
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/20/15.
+// Copyright © 2015 Raizlabs. All rights reserved.
+//
+
+#import
+
+@interface NSObject (RZTransitionsViewHelpers)
+
+- (UIView *)rzt_toView;
+- (UIView *)rzt_fromView;
+
+@end
diff --git a/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.m b/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.m
new file mode 100644
index 0000000..7949a72
--- /dev/null
+++ b/RZTransitions/Utilities/NSObject+RZTransitionsViewHelpers.m
@@ -0,0 +1,45 @@
+//
+// NSObject+RZTransitionsViewHelpers_h.m
+// RZTransitions-Demo
+//
+// Created by Eric Slosser on 11/20/15.
+// Copyright © 2015 Raizlabs. All rights reserved.
+//
+
+#import "NSObject+RZTransitionsViewHelpers.h"
+
+@implementation NSObject (RZTransitionsViewHelpers)
+
+- (UIView *)rzt_toView
+{
+ return [self _RZTViewHelper:YES];
+}
+
+- (UIView *)rzt_fromView
+{
+ return [self _RZTViewHelper:NO];
+}
+
+- (UIView *)_RZTViewHelper:(BOOL)isTo
+{
+ NSAssert([self conformsToProtocol:@protocol(UIViewControllerContextTransitioning)], @"bad parameter");
+ if (![self conformsToProtocol:@protocol(UIViewControllerContextTransitioning)]) {
+ return nil;
+ }
+ id context = (id)self;
+
+ NSString *vcKey = isTo ? UITransitionContextToViewControllerKey : UITransitionContextFromViewControllerKey;
+ UIViewController *vc = [context viewControllerForKey:vcKey];
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
+ if ([context respondsToSelector:@selector(viewForKey:)]) {
+ NSString *vKey = isTo ? UITransitionContextToViewKey : UITransitionContextFromViewKey;
+ return [context viewForKey:vKey];
+ }
+ else {
+ return vc.view;
+ }
+#else
+ return vc.view;
+#endif
+}
+@end
diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m
index 9063fd4..e7b5052 100644
--- a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m
+++ b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m
@@ -111,9 +111,10 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur
UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, [UIScreen mainScreen].scale);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:screenUpdates];
-
- BOOL hasBlur = blurRadius > __FLT_EPSILON__;
- BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__;
+
+
+ BOOL hasBlur = blurRadius > FLT_EPSILON;
+ BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > FLT_EPSILON;
if ( hasBlur || hasSaturationChange ) {
CGContextRef effectInContext = UIGraphicsGetCurrentContext();
diff --git a/Rakefile b/Rakefile
index 4142903..b7e6d31 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,5 +1,6 @@
PROJ_PATH="RZTransitions-Demo/RZTransitions-Demo.xcodeproj"
-BUILD_SCHEME="RZTransitions-Demo"
+DEMO_OBJC="RZTransitions-Demo"
+DEMO_SWIFT="RZTransitions-Demo-Swift"
#
# Install
@@ -14,7 +15,8 @@ end
# Build
#
task :build do
- sh("xctool -project '#{PROJ_PATH}' -scheme '#{BUILD_SCHEME}' -sdk iphonesimulator build") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_OBJC}' -sdk iphonesimulator build") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_SWIFT}' -sdk iphonesimulator build") rescue nil
exit $?.exitstatus
end
@@ -23,7 +25,8 @@ end
#
task :analyze do
- sh("xctool -project '#{PROJ_PATH}' -scheme '#{BUILD_SCHEME}' -sdk iphonesimulator analyze -failOnWarnings") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_OBJC}' -sdk iphonesimulator analyze -failOnWarnings") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_SWIFT}' -sdk iphonesimulator analyze -failOnWarnings") rescue nil
exit $?.exitstatus
end
@@ -32,7 +35,8 @@ end
#
task :clean do
- sh("xctool -project '#{PROJ_PATH}' -scheme '#{BUILD_SCHEME}' -sdk iphonesimulator clean") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_OBJC}' -sdk iphonesimulator clean") rescue nil
+ sh("xctool -project '#{PROJ_PATH}' -scheme '#{DEMO_SWIFT}' -sdk iphonesimulator clean") rescue nil
end
#