Skip to content

Commit

Permalink
Added FallInOut example and tweaked the timings for fallIn/Out
Browse files Browse the repository at this point in the history
  • Loading branch information
neror committed Dec 2, 2009
1 parent 108d7ea commit bcaf78b
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Classes/FTAnimationManager.m
Expand Up @@ -384,7 +384,6 @@ - (CAAnimation *)fallInAnimationFor:(UIView *)view duration:(NSTimeInterval)dura
CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration
delegate:delegate startSelector:startSelector stopSelector:stopSelector delegate:delegate startSelector:startSelector stopSelector:stopSelector
name:kFTAnimationFallIn type:kFTAnimationTypeIn]; name:kFTAnimationFallIn type:kFTAnimationTypeIn];
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
return group; return group;
} }


Expand All @@ -404,7 +403,6 @@ - (CAAnimation *)fallOutAnimationFor:(UIView *)view duration:(NSTimeInterval)dur
CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration CAAnimationGroup *group = [self animationGroupFor:[NSArray arrayWithObjects:fall, fade, nil] withView:view duration:duration
delegate:delegate startSelector:startSelector stopSelector:stopSelector delegate:delegate startSelector:startSelector stopSelector:stopSelector
name:kFTAnimationFallOut type:kFTAnimationTypeOut]; name:kFTAnimationFallOut type:kFTAnimationTypeOut];
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
return group; return group;
} }


Expand Down
2 changes: 2 additions & 0 deletions Examples/ExampleManager.m
Expand Up @@ -29,6 +29,7 @@ of this software and associated documentation files (the "Software"), to deal
#import "FadeInOut.h" #import "FadeInOut.h"
#import "FadeBackgroundColorInOut.h" #import "FadeBackgroundColorInOut.h"
#import "PopInOut.h" #import "PopInOut.h"
#import "FallInOut.h"


@interface ExampleManager () @interface ExampleManager ()


Expand Down Expand Up @@ -69,6 +70,7 @@ - (id)init {
[FadeInOut class], [FadeInOut class],
[FadeBackgroundColorInOut class], [FadeBackgroundColorInOut class],
[PopInOut class], [PopInOut class],
[FallInOut class],
nil], nil],
nil]; nil];
} }
Expand Down
31 changes: 31 additions & 0 deletions Examples/FallInOut.h
@@ -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
43 changes: 43 additions & 0 deletions Examples/FallInOut.m
@@ -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
6 changes: 6 additions & 0 deletions FTUtils.xcodeproj/project.pbxproj
Expand Up @@ -22,6 +22,7 @@
DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06C510C721E0004434C3 /* FadeInOut.m */; }; DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06C510C721E0004434C3 /* FadeInOut.m */; };
DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */; }; DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */; };
DF3E071410C72581004434C3 /* PopInOut.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3E071310C72581004434C3 /* PopInOut.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 */; }; DFA2EA8A10C2AC89003A76FF /* FTUtils+NSObject.m in Sources */ = {isa = PBXBuildFile; fileRef = DFFBF80910ADF405008DB0B9 /* FTUtils+NSObject.m */; };
DFE4EF141035CC4D006A7598 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; }; DFE4EF141035CC4D006A7598 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; };
DFE4EF1C1035CC97006A7598 /* OCMock.framework in Copy OCMock */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; }; DFE4EF1C1035CC97006A7598 /* OCMock.framework in Copy OCMock */ = {isa = PBXBuildFile; fileRef = DFE4EF131035CC4D006A7598 /* OCMock.framework */; };
Expand Down Expand Up @@ -93,6 +94,8 @@
DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FadeBackgroundColorInOut.m; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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; }; 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>"; }; DFE4EF0C1035CBCB006A7598 /* UnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -277,6 +280,8 @@
DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */, DF3E06F010C723F0004434C3 /* FadeBackgroundColorInOut.m */,
DF3E071210C72581004434C3 /* PopInOut.h */, DF3E071210C72581004434C3 /* PopInOut.h */,
DF3E071310C72581004434C3 /* PopInOut.m */, DF3E071310C72581004434C3 /* PopInOut.m */,
DF3E073210C72689004434C3 /* FallInOut.h */,
DF3E073310C72689004434C3 /* FallInOut.m */,
); );
name = "Simple View Animation"; name = "Simple View Animation";
sourceTree = "<group>"; sourceTree = "<group>";
Expand Down Expand Up @@ -458,6 +463,7 @@
DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */, DF3E06C610C721E0004434C3 /* FadeInOut.m in Sources */,
DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */, DF3E06F110C723F0004434C3 /* FadeBackgroundColorInOut.m in Sources */,
DF3E071410C72581004434C3 /* PopInOut.m in Sources */, DF3E071410C72581004434C3 /* PopInOut.m in Sources */,
DF3E073410C72689004434C3 /* FallInOut.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
Expand Down

0 comments on commit bcaf78b

Please sign in to comment.