- Got rid of unused files (category)

- Added shadow to the slide menu
This commit is contained in:
Aryan Gh 2013-04-26 21:52:16 -07:00
parent 7f1765938c
commit 1250954205
6 changed files with 50 additions and 72 deletions

View File

@ -30,7 +30,6 @@
15CBD684172A20DA00F0C53E /* left-menu-button.png in Resources */ = {isa = PBXBuildFile; fileRef = 15CBD682172A20DA00F0C53E /* left-menu-button.png */; };
15CBD685172A20DA00F0C53E /* right-menu-button.png in Resources */ = {isa = PBXBuildFile; fileRef = 15CBD683172A20DA00F0C53E /* right-menu-button.png */; };
15CBD689172A22B700F0C53E /* ProfileDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CBD688172A22B700F0C53E /* ProfileDetailViewController.m */; };
15CBD697172A579700F0C53E /* UINavigationBar+RoundedCorners.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CBD696172A579700F0C53E /* UINavigationBar+RoundedCorners.m */; };
15CBD699172A57F100F0C53E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBD698172A57F100F0C53E /* QuartzCore.framework */; };
/* End PBXBuildFile section */
@ -78,8 +77,6 @@
15CBD683172A20DA00F0C53E /* right-menu-button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "right-menu-button.png"; sourceTree = "<group>"; };
15CBD687172A22B600F0C53E /* ProfileDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileDetailViewController.h; sourceTree = "<group>"; };
15CBD688172A22B700F0C53E /* ProfileDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProfileDetailViewController.m; sourceTree = "<group>"; };
15CBD695172A579700F0C53E /* UINavigationBar+RoundedCorners.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+RoundedCorners.h"; sourceTree = "<group>"; };
15CBD696172A579700F0C53E /* UINavigationBar+RoundedCorners.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationBar+RoundedCorners.m"; sourceTree = "<group>"; };
15CBD698172A57F100F0C53E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@ -192,8 +189,6 @@
15CBD681172A209500F0C53E /* Assets */,
15371F261728E44E00A508F4 /* SlideNavigationController.h */,
15371F271728E44E00A508F4 /* SlideNavigationController.m */,
15CBD695172A579700F0C53E /* UINavigationBar+RoundedCorners.h */,
15CBD696172A579700F0C53E /* UINavigationBar+RoundedCorners.m */,
);
path = Source;
sourceTree = "<group>";
@ -342,7 +337,6 @@
15CBD67D172A15F900F0C53E /* MenuViewController.m in Sources */,
15CBD67E172A15F900F0C53E /* ProfileViewController.m in Sources */,
15CBD689172A22B700F0C53E /* ProfileDetailViewController.m in Sources */,
15CBD697172A579700F0C53E /* UINavigationBar+RoundedCorners.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -45,8 +45,22 @@
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
bundle: nil];
UIViewController *vc = (MenuViewController*)[mainStoryboard
instantiateViewControllerWithIdentifier: @"ProfileViewController"];
UIViewController *vc ;
switch (indexPath.row)
{
case 0:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"HomeViewController"];
break;
case 1:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"ProfileViewController"];
break;
case 2:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"ProfileViewController"];
break;
}
[[SlideNavigationController sharedInstance] switchViewController:vc withCompletion:nil];
}

View File

@ -31,20 +31,32 @@ static SlideNavigationController *singletonInstance;
- (void)awakeFromNib
{
singletonInstance = self;
self.delegate = self;
[self setup];
}
- (id)init
{
if (self = [super init])
{
singletonInstance = self;
[self setup];
}
return self;
}
- (void)setup
{
singletonInstance = self;
self.delegate = self;
self.view.layer.shadowColor = [UIColor darkGrayColor].CGColor;
self.view.layer.shadowRadius = 10;
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
self.view.layer.shadowOpacity = 1;
self.view.layer.shouldRasterize = YES;
self.view.layer.rasterizationScale = [UIScreen mainScreen].scale;
}
#pragma mark - Public Methods -
- (void)switchViewController:(UIViewController *)viewController withCompletion:(void (^)())completion
@ -58,13 +70,10 @@ static SlideNavigationController *singletonInstance;
self.view.frame = rect;
} completion:^(BOOL finished) {
[UIView animateWithDuration:MENU_SLIDE_ANIMATION_DURATION animations:^{
rect.origin.x = 0;
self.view.frame = rect;
[self popToRootViewControllerAnimated:NO];
[self pushViewController:viewController animated:NO];
[self popToRootViewControllerAnimated:NO];
[self pushViewController:viewController animated:NO];
[self closeMenuWithCompletion:^{
if (completion)
completion();
}];

View File

@ -1,14 +0,0 @@
//
// UINavigationBar+RoundedCorners.h
// SlideMenu
//
// Created by Aryan Gh on 4/25/13.
// Copyright (c) 2013 Aryan Ghassemi. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface UINavigationBar (RoundedCorners)
@end

View File

@ -1,40 +0,0 @@
//
// UINavigationBar+RoundedCorners.m
// SlideMenu
//
// Created by Aryan Gh on 4/25/13.
// Copyright (c) 2013 Aryan Ghassemi. All rights reserved.
//
#import "UINavigationBar+RoundedCorners.h"
@implementation UINavigationBar (RoundedCorners)
NSInteger ind = 0;
- (void)awakeFromNib
{
CALayer *capa = self.layer;
[capa setShadowColor: [[UIColor blackColor] CGColor]];
[capa setShadowOpacity:0.85f];
[capa setShadowOffset: CGSizeMake(0.0f, 1.5f)];
[capa setShadowRadius:4.0f];
[capa setShouldRasterize:YES];
[capa setRasterizationScale:[UIScreen mainScreen].scale];
CGRect bounds = capa.bounds;
bounds.size.height += 10.0f;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds
byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight)
cornerRadii:CGSizeMake(5.0, 5.0)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = bounds;
maskLayer.path = maskPath.CGPath;
[capa addSublayer:maskLayer];
ind = [self.layer.sublayers indexOfObject:maskLayer];
capa.mask = maskLayer;
}
@end

View File

@ -72,9 +72,24 @@
<segue destination="BLR-mt-TZ9" kind="push" id="Z6R-Ri-GZ4"/>
</connections>
</button>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="liN-HX-4nb">
<segments>
<segment title="First"/>
<segment title="Second"/>
</segments>
</segmentedControl>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="5Jz-Yy-2WY">
<constraints>
<constraint firstAttribute="width" constant="114" id="49B-Qz-2Hc"/>
</constraints>
</slider>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="5Jz-Yy-2WY" firstAttribute="top" secondItem="nXC-Mu-u90" secondAttribute="top" constant="251" id="1zS-Ah-2Hz"/>
<constraint firstAttribute="trailing" secondItem="5Jz-Yy-2WY" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="Ein-yb-hQ0"/>
<constraint firstItem="liN-HX-4nb" firstAttribute="leading" secondItem="nXC-Mu-u90" secondAttribute="leading" constant="26" id="mDt-La-5IM"/>
<constraint firstItem="liN-HX-4nb" firstAttribute="top" secondItem="nXC-Mu-u90" secondAttribute="top" constant="32" id="odl-3V-5WW"/>
<constraint firstItem="coh-kj-UCb" firstAttribute="top" secondItem="nXC-Mu-u90" secondAttribute="top" constant="116" id="r8I-zY-MHB"/>
<constraint firstItem="coh-kj-UCb" firstAttribute="leading" secondItem="nXC-Mu-u90" secondAttribute="leading" constant="143" id="wxy-h2-ep0"/>
</constraints>