Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 14, 2018. It is now read-only.

Release 1.3.2 #206

Merged
merged 5 commits into from
Nov 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ECSlidingViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ECSlidingViewController'
s.version = '1.3.1'
s.version = '1.3.2'
s.license = { :type => 'MIT', :text => <<-LICENSE
Copyright (C) 2013 EdgeCase

Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.description = 'ECSlidingViewController is a view controller container that presents its child view controllers in two layers. It provides functionality for sliding the top view to reveal the views underneath it. This functionality is inspired by the Path 2.0 and Facebook iPhone apps.'
s.homepage = 'https://github.com/edgecase/ecslidingviewcontroller'
s.author = { 'Mike Enriquez' => '[email protected]' }
s.source = { :git => 'https://github.com/edgecase/ECSlidingViewController.git', :tag => '1.3.1' }
s.source = { :git => 'https://github.com/edgecase/ECSlidingViewController.git', :tag => '1.3.2' }
s.platform = :ios
s.source_files = 'ECSlidingViewController/Vendor/ECSlidingViewController/'
s.requires_arc = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ - (void)setUnderRightViewController:(UIViewController *)theUnderRightViewControl

- (void)setUnderLeftWidthLayout:(ECViewWidthLayout)underLeftWidthLayout
{
if (underLeftWidthLayout == ECVariableRevealWidth && self.anchorRightPeekAmount <= 0) {
if (underLeftWidthLayout == ECVariableRevealWidth && self.anchorRightPeekAmount <= 0.0f) {
[NSException raise:@"Invalid Width Layout" format:@"anchorRightPeekAmount must be set"];
} else if (underLeftWidthLayout == ECFixedRevealWidth && self.anchorRightRevealAmount <= 0) {
} else if (underLeftWidthLayout == ECFixedRevealWidth && self.anchorRightRevealAmount <= 0.0f) {
[NSException raise:@"Invalid Width Layout" format:@"anchorRightRevealAmount must be set"];
}

Expand All @@ -182,9 +182,9 @@ - (void)setUnderLeftWidthLayout:(ECViewWidthLayout)underLeftWidthLayout

- (void)setUnderRightWidthLayout:(ECViewWidthLayout)underRightWidthLayout
{
if (underRightWidthLayout == ECVariableRevealWidth && self.anchorLeftPeekAmount <= 0) {
if (underRightWidthLayout == ECVariableRevealWidth && self.anchorLeftPeekAmount <= 0.0f) {
[NSException raise:@"Invalid Width Layout" format:@"anchorLeftPeekAmount must be set"];
} else if (underRightWidthLayout == ECFixedRevealWidth && self.anchorLeftRevealAmount <= 0) {
} else if (underRightWidthLayout == ECFixedRevealWidth && self.anchorLeftRevealAmount <= 0.0f) {
[NSException raise:@"Invalid Width Layout" format:@"anchorLeftRevealAmount must be set"];
}

Expand Down Expand Up @@ -250,7 +250,7 @@ - (void)adjustLayout
} else if ([self underLeftShowing] && [self topViewIsOffScreen]) {
[self updateUnderLeftLayout];
self.topViewController.view.frame = [self fullViewBounds];
[self updateTopViewHorizontalCenter:self.view.bounds.size.width + self.resettedCenter];
[self updateTopViewHorizontalCenter:CGRectGetWidth(self.view.bounds) + self.resettedCenter];
} else {
self.topViewController.view.frame = [self fullViewBounds];
}
Expand Down Expand Up @@ -304,8 +304,8 @@ - (UIView *)statusBarBackgroundView
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;

if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
CGFloat width = statusBarFrame.size.height;
CGFloat height = statusBarFrame.size.width;
CGFloat width = CGRectGetHeight(statusBarFrame);
CGFloat height = CGRectGetWidth(statusBarFrame);
statusBarFrame.size.width = width;
statusBarFrame.size.height = height;
}
Expand Down Expand Up @@ -383,7 +383,7 @@ - (void)anchorTopViewOffScreenTo:(ECSide)side animations:(void(^)())animations o
if (side == ECLeft) {
newCenter = -self.resettedCenter;
} else if (side == ECRight) {
newCenter = self.view.bounds.size.width + self.resettedCenter;
newCenter = CGRectGetWidth(self.view.bounds) + self.resettedCenter;
}

[self topViewHorizontalCenterWillChange:newCenter];
Expand Down Expand Up @@ -533,7 +533,7 @@ - (void)removeTopViewSnapshot
- (CGFloat)anchorRightTopViewCenter
{
if (self.anchorRightPeekAmount) {
return self.view.bounds.size.width + self.resettedCenter - self.anchorRightPeekAmount;
return CGRectGetWidth(self.view.bounds) + self.resettedCenter - self.anchorRightPeekAmount;
} else if (self.anchorRightRevealAmount) {
return self.resettedCenter + self.anchorRightRevealAmount;
} else {
Expand All @@ -546,38 +546,41 @@ - (CGFloat)anchorLeftTopViewCenter
if (self.anchorLeftPeekAmount) {
return -self.resettedCenter + self.anchorLeftPeekAmount;
} else if (self.anchorLeftRevealAmount) {
return -self.resettedCenter + (self.view.bounds.size.width - self.anchorLeftRevealAmount);
return -self.resettedCenter + (CGRectGetWidth(self.view.bounds) - self.anchorLeftRevealAmount);
} else {
return NSNotFound;
}
}

- (CGFloat)resettedCenter
{
return (self.view.bounds.size.width / 2);
return (CGRectGetWidth(self.view.bounds) / 2.0f);
}

- (CGRect)fullViewBounds
{
CGFloat statusBarHeight = 0;

BOOL legacyScreenHeightEnabled = NO;
if (floor(NSFoundationVersionNumber) <= 993.00) {
legacyScreenHeightEnabled = YES;
}
CGFloat statusBarHeight = 0.0f;

/**
Enable legacy screen height support if we are running on an SDK prior to iOS 6
and thus does not support the supportedInterfaceOrientationsForWindow: selector on
UIApplication, which was introduced in iOS 6
*/
UIApplication *sharedApplication = [UIApplication sharedApplication];
BOOL legacyScreenHeightEnabled = ![sharedApplication respondsToSelector:@selector(supportedInterfaceOrientationsForWindow:)];

if (self.shouldAdjustChildViewHeightForStatusBar || legacyScreenHeightEnabled) {
statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.width;
statusBarHeight = sharedApplication.statusBarFrame.size.height;
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
statusBarHeight = sharedApplication.statusBarFrame.size.width;
}
}

CGRect bounds = [UIScreen mainScreen].bounds;

if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
CGFloat height = bounds.size.width;
CGFloat width = bounds.size.height;
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
CGFloat height = CGRectGetWidth(bounds);
CGFloat width = CGRectGetHeight(bounds);
bounds.size.height = height;
bounds.size.width = width;
}
Expand Down Expand Up @@ -645,7 +648,7 @@ - (void)updateUnderLeftLayout
} else if (self.underLeftWidthLayout == ECVariableRevealWidth && !self.topViewIsOffScreen) {
CGRect frame = [self fullViewBounds];

frame.size.width = frame.size.width - self.anchorRightPeekAmount;
frame.size.width -= self.anchorRightPeekAmount;
self.underLeftView.frame = frame;
} else if (self.underLeftWidthLayout == ECFixedRevealWidth) {
CGRect frame = [self fullViewBounds];
Expand All @@ -666,10 +669,10 @@ - (void)updateUnderRightLayout
CGRect frame = [self fullViewBounds];

CGFloat newLeftEdge;
CGFloat newWidth = frame.size.width;
CGFloat newWidth = CGRectGetWidth(frame);

if (self.topViewIsOffScreen) {
newLeftEdge = 0;
newLeftEdge = 0.0f;
} else {
newLeftEdge = self.anchorLeftPeekAmount;
newWidth -= self.anchorLeftPeekAmount;
Expand All @@ -682,7 +685,7 @@ - (void)updateUnderRightLayout
} else if (self.underRightWidthLayout == ECFixedRevealWidth) {
CGRect frame = [self fullViewBounds];

CGFloat newLeftEdge = frame.size.width - self.anchorLeftRevealAmount;
CGFloat newLeftEdge = CGRectGetWidth(frame) - self.anchorLeftRevealAmount;
CGFloat newWidth = self.anchorLeftRevealAmount;

frame.origin.x = newLeftEdge;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You'll need these two files:

OR - you can use [CocoaPods](http://cocoapods.org/). Add the following line to your Podspec:

pod 'ECSlidingViewController', '~> 1.3.1'
pod 'ECSlidingViewController', '~> 1.3'

### Setup storyboards and set the topViewController

Expand Down