Skip to content

Commit ed40854

Browse files
committed
Merge pull request ECSlidingViewController#206 from edgecase/release/1.3.2
Release 1.3.2
2 parents 279d0fc + f792c24 commit ed40854

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

ECSlidingViewController.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ECSlidingViewController'
3-
s.version = '1.3.1'
3+
s.version = '1.3.2'
44
s.license = { :type => 'MIT', :text => <<-LICENSE
55
Copyright (C) 2013 EdgeCase
66
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515
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.'
1616
s.homepage = 'https://github.com/edgecase/ecslidingviewcontroller'
1717
s.author = { 'Mike Enriquez' => '[email protected]' }
18-
s.source = { :git => 'https://github.com/edgecase/ECSlidingViewController.git', :tag => '1.3.1' }
18+
s.source = { :git => 'https://github.com/edgecase/ECSlidingViewController.git', :tag => '1.3.2' }
1919
s.platform = :ios
2020
s.source_files = 'ECSlidingViewController/Vendor/ECSlidingViewController/'
2121
s.requires_arc = true

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ - (void)setUnderRightViewController:(UIViewController *)theUnderRightViewControl
171171

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

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

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

@@ -250,7 +250,7 @@ - (void)adjustLayout
250250
} else if ([self underLeftShowing] && [self topViewIsOffScreen]) {
251251
[self updateUnderLeftLayout];
252252
self.topViewController.view.frame = [self fullViewBounds];
253-
[self updateTopViewHorizontalCenter:self.view.bounds.size.width + self.resettedCenter];
253+
[self updateTopViewHorizontalCenter:CGRectGetWidth(self.view.bounds) + self.resettedCenter];
254254
} else {
255255
self.topViewController.view.frame = [self fullViewBounds];
256256
}
@@ -304,8 +304,8 @@ - (UIView *)statusBarBackgroundView
304304
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
305305

306306
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
307-
CGFloat width = statusBarFrame.size.height;
308-
CGFloat height = statusBarFrame.size.width;
307+
CGFloat width = CGRectGetHeight(statusBarFrame);
308+
CGFloat height = CGRectGetWidth(statusBarFrame);
309309
statusBarFrame.size.width = width;
310310
statusBarFrame.size.height = height;
311311
}
@@ -383,7 +383,7 @@ - (void)anchorTopViewOffScreenTo:(ECSide)side animations:(void(^)())animations o
383383
if (side == ECLeft) {
384384
newCenter = -self.resettedCenter;
385385
} else if (side == ECRight) {
386-
newCenter = self.view.bounds.size.width + self.resettedCenter;
386+
newCenter = CGRectGetWidth(self.view.bounds) + self.resettedCenter;
387387
}
388388

389389
[self topViewHorizontalCenterWillChange:newCenter];
@@ -533,7 +533,7 @@ - (void)removeTopViewSnapshot
533533
- (CGFloat)anchorRightTopViewCenter
534534
{
535535
if (self.anchorRightPeekAmount) {
536-
return self.view.bounds.size.width + self.resettedCenter - self.anchorRightPeekAmount;
536+
return CGRectGetWidth(self.view.bounds) + self.resettedCenter - self.anchorRightPeekAmount;
537537
} else if (self.anchorRightRevealAmount) {
538538
return self.resettedCenter + self.anchorRightRevealAmount;
539539
} else {
@@ -546,38 +546,41 @@ - (CGFloat)anchorLeftTopViewCenter
546546
if (self.anchorLeftPeekAmount) {
547547
return -self.resettedCenter + self.anchorLeftPeekAmount;
548548
} else if (self.anchorLeftRevealAmount) {
549-
return -self.resettedCenter + (self.view.bounds.size.width - self.anchorLeftRevealAmount);
549+
return -self.resettedCenter + (CGRectGetWidth(self.view.bounds) - self.anchorLeftRevealAmount);
550550
} else {
551551
return NSNotFound;
552552
}
553553
}
554554

555555
- (CGFloat)resettedCenter
556556
{
557-
return (self.view.bounds.size.width / 2);
557+
return (CGRectGetWidth(self.view.bounds) / 2.0f);
558558
}
559559

560560
- (CGRect)fullViewBounds
561561
{
562-
CGFloat statusBarHeight = 0;
563-
564-
BOOL legacyScreenHeightEnabled = NO;
565-
if (floor(NSFoundationVersionNumber) <= 993.00) {
566-
legacyScreenHeightEnabled = YES;
567-
}
562+
CGFloat statusBarHeight = 0.0f;
563+
564+
/**
565+
Enable legacy screen height support if we are running on an SDK prior to iOS 6
566+
and thus does not support the supportedInterfaceOrientationsForWindow: selector on
567+
UIApplication, which was introduced in iOS 6
568+
*/
569+
UIApplication *sharedApplication = [UIApplication sharedApplication];
570+
BOOL legacyScreenHeightEnabled = ![sharedApplication respondsToSelector:@selector(supportedInterfaceOrientationsForWindow:)];
568571

569572
if (self.shouldAdjustChildViewHeightForStatusBar || legacyScreenHeightEnabled) {
570-
statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
571-
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
572-
statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.width;
573+
statusBarHeight = sharedApplication.statusBarFrame.size.height;
574+
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
575+
statusBarHeight = sharedApplication.statusBarFrame.size.width;
573576
}
574577
}
575578

576579
CGRect bounds = [UIScreen mainScreen].bounds;
577580

578-
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
579-
CGFloat height = bounds.size.width;
580-
CGFloat width = bounds.size.height;
581+
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
582+
CGFloat height = CGRectGetWidth(bounds);
583+
CGFloat width = CGRectGetHeight(bounds);
581584
bounds.size.height = height;
582585
bounds.size.width = width;
583586
}
@@ -645,7 +648,7 @@ - (void)updateUnderLeftLayout
645648
} else if (self.underLeftWidthLayout == ECVariableRevealWidth && !self.topViewIsOffScreen) {
646649
CGRect frame = [self fullViewBounds];
647650

648-
frame.size.width = frame.size.width - self.anchorRightPeekAmount;
651+
frame.size.width -= self.anchorRightPeekAmount;
649652
self.underLeftView.frame = frame;
650653
} else if (self.underLeftWidthLayout == ECFixedRevealWidth) {
651654
CGRect frame = [self fullViewBounds];
@@ -666,10 +669,10 @@ - (void)updateUnderRightLayout
666669
CGRect frame = [self fullViewBounds];
667670

668671
CGFloat newLeftEdge;
669-
CGFloat newWidth = frame.size.width;
672+
CGFloat newWidth = CGRectGetWidth(frame);
670673

671674
if (self.topViewIsOffScreen) {
672-
newLeftEdge = 0;
675+
newLeftEdge = 0.0f;
673676
} else {
674677
newLeftEdge = self.anchorLeftPeekAmount;
675678
newWidth -= self.anchorLeftPeekAmount;
@@ -682,7 +685,7 @@ - (void)updateUnderRightLayout
682685
} else if (self.underRightWidthLayout == ECFixedRevealWidth) {
683686
CGRect frame = [self fullViewBounds];
684687

685-
CGFloat newLeftEdge = frame.size.width - self.anchorLeftRevealAmount;
688+
CGFloat newLeftEdge = CGRectGetWidth(frame) - self.anchorLeftRevealAmount;
686689
CGFloat newWidth = self.anchorLeftRevealAmount;
687690

688691
frame.origin.x = newLeftEdge;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You'll need these two files:
3636

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

39-
pod 'ECSlidingViewController', '~> 1.3.1'
39+
pod 'ECSlidingViewController', '~> 1.3'
4040

4141
### Setup storyboards and set the topViewController
4242

0 commit comments

Comments
 (0)