Skip to content

Commit

Permalink
Updated demo
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Apr 16, 2014
1 parent 06aad96 commit 2082890
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 45 deletions.
6 changes: 3 additions & 3 deletions AMWaveTransition/AMWaveTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ @implementation AMWaveTransition

#define SCREEN_WIDTH ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height)

#define DURATION 0.5
#define MAX_DELAY 0.25
#define DURATION 0.65
#define MAX_DELAY 0.15

- (instancetype)init
{
Expand All @@ -34,7 +34,7 @@ - (instancetype)initWithOperation:(UINavigationControllerOperation)operation
self = [super init];
if (self) {
_operation = operation;
_transitionType = AMWaveTransitionTypeNervous;
_transitionType = AMWaveTransitionTypeSubtle;
}
return self;
}
Expand Down
13 changes: 13 additions & 0 deletions AMWaveTransition/AMWaveViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// AMWaveViewController.h
// Demo
//
// Created by Andrea Mazzini on 16/04/14.
// Copyright (c) 2014 Fancy Pixel. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AMWaveViewController : UIViewController

@end
50 changes: 50 additions & 0 deletions AMWaveTransition/AMWaveViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// AMWaveViewController.m
// Demo
//
// Created by Andrea Mazzini on 16/04/14.
// Copyright (c) 2014 Fancy Pixel. All rights reserved.
//

#import "AMWaveViewController.h"
#import "AMWaveTransition.h"

@interface AMWaveViewController () <UINavigationControllerDelegate, AMWaveTransitioning>

@end

@implementation AMWaveViewController

- (void)viewDidLoad
{
[super viewDidLoad];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.navigationController setDelegate:self];
}

- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
animationControllerForOperation:(UINavigationControllerOperation)operation
fromViewController:(UIViewController*)fromVC
toViewController:(UIViewController*)toVC
{
if (operation != UINavigationControllerOperationNone) {
return [AMWaveTransition transitionWithOperation:operation];
}
return nil;
}

- (NSArray*)visibleCells
{
return nil;
}

- (void)dealloc
{
[self.navigationController setDelegate:nil];
}

@end
6 changes: 6 additions & 0 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
6509E34D18FF0CEE0054FD6F /* AMWaveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6509E34C18FF0CEE0054FD6F /* AMWaveViewController.m */; };
65E0370A18FE6BE200EFA799 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E0370918FE6BE200EFA799 /* Foundation.framework */; };
65E0370C18FE6BE200EFA799 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E0370B18FE6BE200EFA799 /* CoreGraphics.framework */; };
65E0370E18FE6BE200EFA799 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E0370D18FE6BE200EFA799 /* UIKit.framework */; };
Expand Down Expand Up @@ -36,6 +37,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
6509E34B18FF0CEE0054FD6F /* AMWaveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMWaveViewController.h; sourceTree = "<group>"; };
6509E34C18FF0CEE0054FD6F /* AMWaveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMWaveViewController.m; sourceTree = "<group>"; };
65E0370618FE6BE200EFA799 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
65E0370918FE6BE200EFA799 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
65E0370B18FE6BE200EFA799 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -166,6 +169,8 @@
children = (
65E0373F18FE6C2500EFA799 /* AMWaveTransition.h */,
65E0374018FE6C2500EFA799 /* AMWaveTransition.m */,
6509E34B18FF0CEE0054FD6F /* AMWaveViewController.h */,
6509E34C18FF0CEE0054FD6F /* AMWaveViewController.m */,
);
name = AMWaveTransition;
path = ../../AMWaveTransition;
Expand Down Expand Up @@ -273,6 +278,7 @@
65E0374118FE6C2500EFA799 /* AMWaveTransition.m in Sources */,
65E0371A18FE6BE200EFA799 /* AppDelegate.m in Sources */,
65E0371618FE6BE200EFA799 /* main.m in Sources */,
6509E34D18FF0CEE0054FD6F /* AMWaveViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
35 changes: 7 additions & 28 deletions Demo/Demo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,14 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
[[UIApplication sharedApplication] setStatusBarHidden:NO];
NSDictionary *attributes = @{ NSFontAttributeName: [UIFont fontWithName:@"GillSans-Light" size:20],
NSForegroundColorAttributeName: [UIColor whiteColor]};
[[UINavigationBar appearance] setTitleTextAttributes:attributes];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
return YES;
}

@end
26 changes: 19 additions & 7 deletions Demo/Demo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,34 @@
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="vGr-U8-fCr">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="68" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="vGr-U8-fCr">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="cs6-Bw-Gm0" style="IBUITableViewCellStyleDefault" id="0zg-mu-oP0">
<rect key="frame" x="0.0" y="22" width="320" height="44"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="cs6-Bw-Gm0" detailTextLabel="oRp-dV-TdZ" imageView="cXG-vo-fPj" rowHeight="68" style="IBUITableViewCellStyleSubtitle" id="0zg-mu-oP0">
<rect key="frame" x="0.0" y="22" width="320" height="68"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0zg-mu-oP0" id="PTD-s3-Qkg">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="67"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="cs6-Bw-Gm0">
<rect key="frame" x="15" y="0.0" width="290" height="43"/>
<rect key="frame" x="75" y="15" width="35" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<fontDescription key="fontDescription" name="GillSans-Light" family="Gill Sans" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="profile" id="cXG-vo-fPj">
<rect key="frame" x="15" y="13" width="45" height="40"/>
<autoresizingMask key="autoresizingMask"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oRp-dV-TdZ">
<rect key="frame" x="75" y="38" width="33" height="14"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" name="GillSans-LightItalic" family="Gill Sans" pointSize="12"/>
<color key="textColor" red="0.78431372549019607" green="0.78431372549019607" blue="0.78431372549019607" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand Down Expand Up @@ -149,6 +160,7 @@
</scenes>
<resources>
<image name="camera" width="52" height="40"/>
<image name="profile" width="45" height="40"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
Expand Down
2 changes: 2 additions & 0 deletions Demo/Demo/Demo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
Binary file modified Demo/Demo/Images.xcassets/background.imageset/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "map.png"
"filename" : "glass.png"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Demo/Demo/Images.xcassets/map.imageset/map.png
Binary file not shown.
Binary file modified Demo/Demo/Images.xcassets/navbar.imageset/navbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "paperclip.png"
"filename" : "profile.png"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Demo/Demo/Images.xcassets/puzzle.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "puzzle.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions Demo/Demo/SecondViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ - (void)viewDidAppear:(BOOL)animated

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 20;
return 10;
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
cell.textLabel.text = @"Cell content is here";
cell.textLabel.text = @"John Doe";
cell.detailTextLabel.text = @"Transitions fanatic";
[cell setBackgroundColor:[UIColor clearColor]];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
return cell;
Expand Down
6 changes: 3 additions & 3 deletions Demo/Demo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ - (void)viewDidLoad
@{@"text": @"Stylized organs", @"icon": @"heart"},
@{@"text": @"Food pictures", @"icon": @"camera"},
@{@"text": @"Straight line maker", @"icon": @"pencil"},
@{@"text": @"Let's cook", @"icon": @"beaker"},
@{@"text": @"Beer map", @"icon": @"map"},
@{@"text": @"Clippy is back", @"icon": @"paperclip"}
@{@"text": @"Let's cook!", @"icon": @"beaker"},
@{@"text": @"That's the puzzle!", @"icon": @"puzzle"},
@{@"text": @"Cheers", @"icon": @"glass"}
];
}

Expand Down

0 comments on commit 2082890

Please sign in to comment.