Permalink
Browse files

Added FallInOut example and tweaked the timings for fallIn/Out

  • Loading branch information...
1 parent 108d7ea commit bcaf78baffdf9412db8a6f4b8d8d8b62a0e34f74 @neror committed Dec 2, 2009
Showing with 82 additions and 2 deletions.
  1. +0 −2 Classes/FTAnimationManager.m
  2. +2 −0 Examples/ExampleManager.m
  3. +31 −0 Examples/FallInOut.h
  4. +43 −0 Examples/FallInOut.m
  5. +6 −0 FTUtils.xcodeproj/project.pbxproj
@@ -384,7 +384,6 @@ - (CAAnimation *)fallInAnimationFor:(UIView *)view duration:(NSTimeInterval)dura
CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration
delegate:delegate startSelector:startSelector stopSelector:stopSelector
name:kFTAnimationFallIn type:kFTAnimationTypeIn];
- group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
return group;
}
@@ -404,7 +403,6 @@ - (CAAnimation *)fallOutAnimationFor:(UIView *)view duration:(NSTimeInterval)dur
CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration
delegate:delegate startSelector:startSelector stopSelector:stopSelector
name:kFTAnimationFallOut type:kFTAnimationTypeOut];
- group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
return group;
}
@@ -29,6 +29,7 @@ of this software and associated documentation files (the "Software"), to deal
#import "FadeInOut.h"
#import "FadeBackgroundColorInOut.h"
#import "PopInOut.h"
+#import "FallInOut.h"
@interface ExampleManager ()
@@ -69,6 +70,7 @@ - (id)init {
[FadeInOut class],
[FadeBackgroundColorInOut class],
[PopInOut class],
+ [FallInOut class],
nil],
nil];
}
View
@@ -0,0 +1,31 @@
+/*
+ The MIT License
+
+ Copyright (c) 2009 Free Time Studios and Nathan Eror
+
+ 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 "SimpleAnimationExample.h"
+
+
+@interface FallInOut : SimpleAnimationExample {
+}
+
+@end
View
@@ -0,0 +1,43 @@
+/*
+ The MIT License
+
+ Copyright (c) 2009 Free Time Studios and Nathan Eror
+
+ 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 "FallInOut.h"
+#import "FTAnimation.h"
+
+@implementation FallInOut
+
++ (NSString *)displayName {
+ return @"Fall In/Fall Out";
+}
+
+- (void)performAnimation:(id)sender {
+ if(self.viewToAnimate.hidden) {
+ [self.viewToAnimate fallIn:.4 delegate:nil];
+ } else {
+ [self.viewToAnimate fallOut:.4 delegate:nil];
+ }
+}
+
+
+@end
@@ -22,6 +22,7 @@
DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06C510C721E0004434C3 /* FadeInOut.m */; };
DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */; };
DF3E071410C72581004434C3 /* PopInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E071310C72581004434C3 /* PopInOut.m */; };
+ DF3E073410C72689004434C3 /* FallInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E073310C72689004434C3 /* FallInOut.m */; };
DFA2EA8A10C2AC89003A76FF /* FTUtils+NSObject.m in Sources */ = {isa = PBXBuildFile; fileRef = DFFBF80910ADF405008DB0B9 /* FTUtils+NSObject.m */; };
DFE4EF141035CC4D006A7598 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; };
DFE4EF1C1035CC97006A7598 /* OCMock.framework in Copy OCMock */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; };
@@ -93,6 +94,8 @@
DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FadeBackgroundColorInOut.m; sourceTree = "<group>"; };
DF3E071210C72581004434C3 /* PopInOut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopInOut.h; sourceTree = "<group>"; };
DF3E071310C72581004434C3 /* PopInOut.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopInOut.m; sourceTree = "<group>"; };
+ DF3E073210C72689004434C3 /* FallInOut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FallInOut.h; sourceTree = "<group>"; };
+ DF3E073310C72689004434C3 /* FallInOut.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FallInOut.m; sourceTree = "<group>"; };
DF6D06470FE1A6F200CC44C6 /* README.mdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.mdown; sourceTree = "<group>"; };
DFE4EF0B1035CBCB006A7598 /* UnitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
DFE4EF0C1035CBCB006A7598 /* UnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = "<group>"; };
@@ -277,6 +280,8 @@
DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */,
DF3E071210C72581004434C3 /* PopInOut.h */,
DF3E071310C72581004434C3 /* PopInOut.m */,
+ DF3E073210C72689004434C3 /* FallInOut.h */,
+ DF3E073310C72689004434C3 /* FallInOut.m */,
);
name = "Simple View Animation";
sourceTree = "<group>";
@@ -458,6 +463,7 @@
DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */,
DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */,
DF3E071410C72581004434C3 /* PopInOut.m in Sources */,
+ DF3E073410C72689004434C3 /* FallInOut.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

0 comments on commit bcaf78b

Please sign in to comment.