forked from kentnguyen/KNPathTableViewController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathECSlidingViewController.m
More file actions
610 lines (488 loc) · 21.2 KB
/
ECSlidingViewController.m
File metadata and controls
610 lines (488 loc) · 21.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
//
// ECSlidingViewController.m
// ECSlidingViewController
//
// Created by Michael Enriquez on 1/23/12.
// Copyright (c) 2012 EdgeCase. All rights reserved.
//
#import "ECSlidingViewController.h"
NSString *const ECSlidingViewUnderRightWillAppear = @"ECSlidingViewUnderRightWillAppear";
NSString *const ECSlidingViewUnderLeftWillAppear = @"ECSlidingViewUnderLeftWillAppear";
NSString *const ECSlidingViewTopDidAnchorLeft = @"ECSlidingViewTopDidAnchorLeft";
NSString *const ECSlidingViewTopDidAnchorRight = @"ECSlidingViewTopDidAnchorRight";
NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset";
@interface ECSlidingViewController ()
@property(nonatomic, retain) UIView *topViewSnapshot;
@property(nonatomic) CGFloat initialTouchPositionX;
@property(nonatomic) CGFloat initialHoizontalCenter;
@property(nonatomic, retain) UIPanGestureRecognizer *panGesture;
@property(nonatomic, retain) UITapGestureRecognizer *resetTapGesture;
@property(nonatomic) BOOL underLeftShowing;
@property(nonatomic) BOOL underRightShowing;
@property(nonatomic) BOOL topViewIsOffScreen;
- (NSUInteger)autoResizeToFillScreen;
- (UIView *)topView;
- (UIView *)underLeftView;
- (UIView *)underRightView;
- (void)adjustLayout;
- (void)updateTopViewHorizontalCenterWithRecognizer:(UIPanGestureRecognizer *)recognizer;
- (void)updateTopViewHorizontalCenter:(CGFloat)newHorizontalCenter;
- (void)topViewHorizontalCenterWillChange:(CGFloat)newHorizontalCenter;
- (void)topViewHorizontalCenterDidChange:(CGFloat)newHorizontalCenter;
- (void)addTopViewSnapshot;
- (void)removeTopViewSnapshot;
- (CGFloat)anchorRightTopViewCenter;
- (CGFloat)anchorLeftTopViewCenter;
- (CGFloat)resettedCenter;
- (CGFloat)screenWidth;
- (CGFloat)screenWidthForOrientation:(UIInterfaceOrientation)orientation;
- (void)underLeftWillAppear;
- (void)underRightWillAppear;
- (void)topDidReset;
- (BOOL)topViewHasFocus;
- (void)updateUnderLeftLayout;
- (void)updateUnderRightLayout;
@end
@implementation UIViewController (SlidingViewExtension)
- (ECSlidingViewController *)slidingViewController {
UIViewController *viewController = self.parentViewController;
while (!(viewController == nil || [viewController isKindOfClass:[ECSlidingViewController class]])) {
viewController = viewController.parentViewController;
}
return (ECSlidingViewController *) viewController;
}
@end
@implementation ECSlidingViewController
// public properties
@synthesize underLeftViewController = _underLeftViewController;
@synthesize underRightViewController = _underRightViewController;
@synthesize topViewController = _topViewController;
@synthesize anchorLeftPeekAmount;
@synthesize anchorRightPeekAmount;
@synthesize anchorLeftRevealAmount;
@synthesize anchorRightRevealAmount;
@synthesize underRightWidthLayout = _underRightWidthLayout;
@synthesize underLeftWidthLayout = _underLeftWidthLayout;
@synthesize shouldAllowUserInteractionsWhenAnchored;
@synthesize resetStrategy = _resetStrategy;
// category properties
@synthesize topViewSnapshot;
@synthesize initialTouchPositionX;
@synthesize initialHoizontalCenter;
@synthesize panGesture = _panGesture;
@synthesize resetTapGesture;
@synthesize underLeftShowing = _underLeftShowing;
@synthesize underRightShowing = _underRightShowing;
@synthesize topViewIsOffScreen = _topViewIsOffScreen;
- (void)setTopViewController:(UIViewController *)theTopViewController {
[self removeTopViewSnapshot];
[_topViewController.view removeFromSuperview];
[_topViewController willMoveToParentViewController:nil];
[_topViewController removeFromParentViewController];
[_topViewController release];
_topViewController = [theTopViewController retain];
[self addChildViewController:self.topViewController];
[self.topViewController didMoveToParentViewController:self];
[_topViewController.view setAutoresizingMask:self.autoResizeToFillScreen];
[_topViewController.view setFrame:self.view.bounds];
_topViewController.view.layer.shadowOffset = CGSizeZero;
_topViewController.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath;
_topViewController.view.layer.shadowRadius = 5.0;
[self.view addSubview:_topViewController.view];
}
- (void)setUnderLeftViewController:(UIViewController *)theUnderLeftViewController {
[_underLeftViewController.view removeFromSuperview];
[_underLeftViewController willMoveToParentViewController:nil];
[_underLeftViewController removeFromParentViewController];
[_underLeftViewController release];
_underLeftViewController = [theUnderLeftViewController retain];
if (_underLeftViewController) {
[self addChildViewController:self.underLeftViewController];
[self.underLeftViewController didMoveToParentViewController:self];
[self updateUnderLeftLayout];
[self.view insertSubview:_underLeftViewController.view atIndex:0];
}
}
- (void)setUnderRightViewController:(UIViewController *)theUnderRightViewController {
[_underRightViewController.view removeFromSuperview];
[_underRightViewController willMoveToParentViewController:nil];
[_underRightViewController removeFromParentViewController];
_underRightViewController = [theUnderRightViewController retain];
if (_underRightViewController) {
[self addChildViewController:self.underRightViewController];
[self.underRightViewController didMoveToParentViewController:self];
[self updateUnderRightLayout];
[self.view insertSubview:_underRightViewController.view atIndex:0];
}
}
- (void)setUnderLeftWidthLayout:(ECViewWidthLayout)underLeftWidthLayout {
if (underLeftWidthLayout == ECVariableRevealWidth && self.anchorRightPeekAmount <= 0) {
[NSException raise:@"Invalid Width Layout" format:@"anchorRightPeekAmount must be set"];
} else if (underLeftWidthLayout == ECFixedRevealWidth && self.anchorRightRevealAmount <= 0) {
[NSException raise:@"Invalid Width Layout" format:@"anchorRightRevealAmount must be set"];
}
_underLeftWidthLayout = underLeftWidthLayout;
}
- (void)setUnderRightWidthLayout:(ECViewWidthLayout)underRightWidthLayout {
if (underRightWidthLayout == ECVariableRevealWidth && self.anchorLeftPeekAmount <= 0) {
[NSException raise:@"Invalid Width Layout" format:@"anchorLeftPeekAmount must be set"];
} else if (underRightWidthLayout == ECFixedRevealWidth && self.anchorLeftRevealAmount <= 0) {
[NSException raise:@"Invalid Width Layout" format:@"anchorLeftRevealAmount must be set"];
}
_underRightWidthLayout = underRightWidthLayout;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.shouldAllowUserInteractionsWhenAnchored = NO;
self.resetTapGesture = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resetTopView)] autorelease];
self.panGesture = [[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(updateTopViewHorizontalCenterWithRecognizer:)] autorelease];
self.resetTapGesture.enabled = NO;
self.resetStrategy = ECTapping | ECPanning;
self.topViewSnapshot = [[[UIView alloc] initWithFrame:self.topView.bounds] autorelease];
[self.topViewSnapshot setAutoresizingMask:self.autoResizeToFillScreen];
[self.topViewSnapshot addGestureRecognizer:self.resetTapGesture];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.topView.layer.shadowOffset = CGSizeZero;
self.topView.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath;
[self adjustLayout];
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
self.topView.layer.shadowPath = nil;
self.topView.layer.shouldRasterize = YES;
if (![self topViewHasFocus]) {
[self removeTopViewSnapshot];
}
[self adjustLayout];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
self.topView.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath;
self.topView.layer.shouldRasterize = NO;
if (![self topViewHasFocus]) {
[self addTopViewSnapshot];
}
}
- (void)setResetStrategy:(ECResetStrategy)theResetStrategy {
_resetStrategy = theResetStrategy;
if (_resetStrategy & ECTapping) {
self.resetTapGesture.enabled = YES;
} else {
self.resetTapGesture.enabled = NO;
}
}
- (void)adjustLayout {
self.topViewSnapshot.frame = self.topView.bounds;
if ([self underRightShowing] && ![self topViewIsOffScreen]) {
[self updateUnderRightLayout];
[self updateTopViewHorizontalCenter:self.anchorLeftTopViewCenter];
} else if ([self underRightShowing] && [self topViewIsOffScreen]) {
[self updateUnderRightLayout];
[self updateTopViewHorizontalCenter:-self.resettedCenter];
} else if ([self underLeftShowing] && ![self topViewIsOffScreen]) {
[self updateUnderLeftLayout];
[self updateTopViewHorizontalCenter:self.anchorRightTopViewCenter];
} else if ([self underLeftShowing] && [self topViewIsOffScreen]) {
[self updateUnderLeftLayout];
[self updateTopViewHorizontalCenter:self.screenWidth + self.resettedCenter];
}
}
- (void)updateTopViewHorizontalCenterWithRecognizer:(UIPanGestureRecognizer *)recognizer {
CGPoint currentTouchPoint = [recognizer locationInView:self.view];
CGFloat currentTouchPositionX = currentTouchPoint.x;
if (recognizer.state == UIGestureRecognizerStateBegan) {
self.initialTouchPositionX = currentTouchPositionX;
self.initialHoizontalCenter = self.topView.center.x;
} else if (recognizer.state == UIGestureRecognizerStateChanged) {
CGFloat panAmount = self.initialTouchPositionX - currentTouchPositionX;
CGFloat newCenterPosition = self.initialHoizontalCenter - panAmount;
if ((newCenterPosition < self.resettedCenter && self.anchorLeftTopViewCenter == NSNotFound) || (newCenterPosition > self.resettedCenter && self.anchorRightTopViewCenter == NSNotFound)) {
newCenterPosition = self.resettedCenter;
}
[self topViewHorizontalCenterWillChange:newCenterPosition];
[self updateTopViewHorizontalCenter:newCenterPosition];
[self topViewHorizontalCenterDidChange:newCenterPosition];
} else if (recognizer.state == UIGestureRecognizerStateEnded || recognizer.state == UIGestureRecognizerStateCancelled) {
CGPoint currentVelocityPoint = [recognizer velocityInView:self.view];
CGFloat currentVelocityX = currentVelocityPoint.x;
if ([self underLeftShowing] && currentVelocityX > 100) {
[self anchorTopViewTo:ECRight];
} else if ([self underRightShowing] && currentVelocityX < 100) {
[self anchorTopViewTo:ECLeft];
} else {
[self resetTopView];
}
}
}
- (UIPanGestureRecognizer *)panGesture {
return _panGesture;
}
- (void)anchorTopViewTo:(ECSide)side {
[self anchorTopViewTo:side animations:nil onComplete:nil];
}
- (void)anchorTopViewTo:(ECSide)side animations:(void (^)())animations onComplete:(void (^)())complete {
CGFloat newCenter = self.topView.center.x;
if (side == ECLeft) {
newCenter = self.anchorLeftTopViewCenter;
} else if (side == ECRight) {
newCenter = self.anchorRightTopViewCenter;
}
[self topViewHorizontalCenterWillChange:newCenter];
[UIView animateWithDuration:0.25f animations:^{
if (animations) {
animations();
}
[self updateTopViewHorizontalCenter:newCenter];
} completion:^(BOOL finished) {
if (_resetStrategy & ECPanning) {
self.panGesture.enabled = YES;
} else {
self.panGesture.enabled = NO;
}
if (complete) {
complete();
}
_topViewIsOffScreen = NO;
[self addTopViewSnapshot];
dispatch_async(dispatch_get_main_queue(), ^{
NSString *key = (side == ECLeft) ? ECSlidingViewTopDidAnchorLeft : ECSlidingViewTopDidAnchorRight;
[[NSNotificationCenter defaultCenter] postNotificationName:key object:self userInfo:nil];
});
}];
}
- (void)anchorTopViewOffScreenTo:(ECSide)side {
[self anchorTopViewOffScreenTo:side animations:nil onComplete:nil];
}
- (void)anchorTopViewOffScreenTo:(ECSide)side animations:(void (^)())animations onComplete:(void (^)())complete {
CGFloat newCenter = self.topView.center.x;
if (side == ECLeft) {
newCenter = -self.resettedCenter;
} else if (side == ECRight) {
newCenter = self.screenWidth + self.resettedCenter;
}
[self topViewHorizontalCenterWillChange:newCenter];
[UIView animateWithDuration:0.25f animations:^{
if (animations) {
animations();
}
[self updateTopViewHorizontalCenter:newCenter];
} completion:^(BOOL finished) {
if (complete) {
complete();
}
_topViewIsOffScreen = YES;
[self addTopViewSnapshot];
dispatch_async(dispatch_get_main_queue(), ^{
NSString *key = (side == ECLeft) ? ECSlidingViewTopDidAnchorLeft : ECSlidingViewTopDidAnchorRight;
[[NSNotificationCenter defaultCenter] postNotificationName:key object:self userInfo:nil];
});
}];
}
- (void)resetTopView {
[self resetTopViewWithAnimations:nil onComplete:nil];
}
- (void)resetTopViewWithAnimations:(void (^)())animations onComplete:(void (^)())complete {
[self topViewHorizontalCenterWillChange:self.resettedCenter];
[UIView animateWithDuration:0.25f animations:^{
if (animations) {
animations();
}
[self updateTopViewHorizontalCenter:self.resettedCenter];
} completion:^(BOOL finished) {
if (complete) {
complete();
}
[self topViewHorizontalCenterDidChange:self.resettedCenter];
}];
}
- (BOOL)underLeftShowing {
return _underLeftShowing;
}
- (BOOL)underRightShowing {
return _underRightShowing;
}
- (BOOL)topViewIsOffScreen {
return _topViewIsOffScreen;
}
- (NSUInteger)autoResizeToFillScreen {
return (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin);
}
- (UIView *)topView {
return self.topViewController.view;
}
- (UIView *)underLeftView {
return self.underLeftViewController.view;
}
- (UIView *)underRightView {
return self.underRightViewController.view;
}
- (void)updateTopViewHorizontalCenter:(CGFloat)newHorizontalCenter {
CGPoint center = self.topView.center;
center.x = newHorizontalCenter;
self.topView.layer.position = center;
}
- (void)topViewHorizontalCenterWillChange:(CGFloat)newHorizontalCenter {
CGPoint center = self.topView.center;
if (center.x <= self.resettedCenter && newHorizontalCenter > self.resettedCenter) {
[self underLeftWillAppear];
} else if (center.x >= self.resettedCenter && newHorizontalCenter < self.resettedCenter) {
[self underRightWillAppear];
}
}
- (void)topViewHorizontalCenterDidChange:(CGFloat)newHorizontalCenter {
if (newHorizontalCenter == self.resettedCenter) {
[self topDidReset];
}
}
- (void)addTopViewSnapshot {
if (!self.topViewSnapshot.superview && !self.shouldAllowUserInteractionsWhenAnchored) {
topViewSnapshot.layer.contents = (id) [UIImage imageWithUIView:self.topView].CGImage;
[self.topView addSubview:self.topViewSnapshot];
}
}
- (void)removeTopViewSnapshot {
if (self.topViewSnapshot.superview) {
[self.topViewSnapshot removeFromSuperview];
}
}
- (CGFloat)anchorRightTopViewCenter {
if (self.anchorRightPeekAmount) {
return self.screenWidth + self.resettedCenter - self.anchorRightPeekAmount;
} else if (self.anchorRightRevealAmount) {
return self.resettedCenter + self.anchorRightRevealAmount;
} else {
return NSNotFound;
}
}
- (CGFloat)anchorLeftTopViewCenter {
if (self.anchorLeftPeekAmount) {
return -self.resettedCenter + self.anchorLeftPeekAmount;
} else if (self.anchorLeftRevealAmount) {
return -self.resettedCenter + (self.screenWidth - self.anchorLeftRevealAmount);
} else {
return NSNotFound;
}
}
- (CGFloat)resettedCenter {
return ceil(self.screenWidth / 2);
}
- (CGFloat)screenWidth {
return [self screenWidthForOrientation:[UIApplication sharedApplication].statusBarOrientation];
}
- (CGFloat)screenWidthForOrientation:(UIInterfaceOrientation)orientation {
CGSize size = [UIScreen mainScreen].bounds.size;
UIApplication *application = [UIApplication sharedApplication];
if (UIInterfaceOrientationIsLandscape(orientation)) {
size = CGSizeMake(size.height, size.width);
}
if (application.statusBarHidden == NO) {
size.height -= MIN(application.statusBarFrame.size.width, application.statusBarFrame.size.height);
}
return size.width;
}
- (void)underLeftWillAppear {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderLeftWillAppear object:self userInfo:nil];
});
self.underRightView.hidden = YES;
[self.underLeftViewController viewWillAppear:NO];
self.underLeftView.hidden = NO;
[self updateUnderLeftLayout];
_underLeftShowing = YES;
_underRightShowing = NO;
}
- (void)underRightWillAppear {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderRightWillAppear object:self userInfo:nil];
});
self.underLeftView.hidden = YES;
[self.underRightViewController viewWillAppear:NO];
self.underRightView.hidden = NO;
[self updateUnderRightLayout];
_underLeftShowing = NO;
_underRightShowing = YES;
}
- (void)topDidReset {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewTopDidReset object:self userInfo:nil];
});
[self.topView removeGestureRecognizer:self.resetTapGesture];
[self removeTopViewSnapshot];
self.panGesture.enabled = YES;
_underLeftShowing = NO;
_underRightShowing = NO;
_topViewIsOffScreen = NO;
}
- (BOOL)topViewHasFocus {
return !_underLeftShowing && !_underRightShowing && !_topViewIsOffScreen;
}
- (void)updateUnderLeftLayout {
if (self.underLeftWidthLayout == ECFullWidth) {
[self.underLeftView setAutoresizingMask:self.autoResizeToFillScreen];
[self.underLeftView setFrame:self.view.bounds];
} else if (self.underLeftWidthLayout == ECVariableRevealWidth && !self.topViewIsOffScreen) {
CGRect frame = self.view.bounds;
CGFloat newWidth;
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
newWidth = [UIScreen mainScreen].bounds.size.height - self.anchorRightPeekAmount;
} else {
newWidth = [UIScreen mainScreen].bounds.size.width - self.anchorRightPeekAmount;
}
frame.size.width = newWidth;
self.underLeftView.frame = frame;
} else if (self.underLeftWidthLayout == ECFixedRevealWidth) {
CGRect frame = self.view.bounds;
frame.size.width = self.anchorRightRevealAmount;
self.underLeftView.frame = frame;
} else {
[NSException raise:@"Invalid Width Layout" format:@"underLeftWidthLayout must be a valid ECViewWidthLayout"];
}
}
- (void)updateUnderRightLayout {
if (self.underRightWidthLayout == ECFullWidth) {
[self.underRightViewController.view setAutoresizingMask:self.autoResizeToFillScreen];
self.underRightView.frame = self.view.bounds;
} else if (self.underRightWidthLayout == ECVariableRevealWidth) {
CGRect frame = self.view.bounds;
CGFloat newLeftEdge;
CGFloat newWidth;
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
newWidth = [UIScreen mainScreen].bounds.size.height;
} else {
newWidth = [UIScreen mainScreen].bounds.size.width;
}
if (self.topViewIsOffScreen) {
newLeftEdge = 0;
} else {
newLeftEdge = self.anchorLeftPeekAmount;
newWidth -= self.anchorLeftPeekAmount;
}
frame.origin.x = newLeftEdge;
frame.size.width = newWidth;
self.underRightView.frame = frame;
} else if (self.underRightWidthLayout == ECFixedRevealWidth) {
CGRect frame = self.view.bounds;
CGFloat newLeftEdge = self.screenWidth - self.anchorLeftRevealAmount;
CGFloat newWidth = self.anchorLeftRevealAmount;
frame.origin.x = newLeftEdge;
frame.size.width = newWidth;
self.underRightView.frame = frame;
} else {
[NSException raise:@"Invalid Width Layout" format:@"underRightWidthLayout must be a valid ECViewWidthLayout"];
}
}
#pragma mark -
#pragma mark I AIN'T NO ARC B***CH!
//============================================================================================================
- (void)dealloc {
[_topViewController release], _topViewController = nil;
[_underLeftViewController release], _underLeftViewController = nil;
[_underRightViewController release], _underRightViewController = nil;
[super dealloc];
}
@end