Permalink
Browse files

Fix #9 ok ;)

  • Loading branch information...
1 parent 2f25cc7 commit a1ca242422f0a8b4666df5987ca4a020f869bb99 @ipodishima ipodishima committed Jul 18, 2012
@@ -474,7 +474,18 @@ - (void) preloadViewController:(UIViewController*)controller forSide:(PPRevealSi
withOffset:DefaultOffset];
}
-- (void) preloadViewController:(UIViewController*)controller forSide:(PPRevealSideDirection)direction withOffset:(CGFloat)offset {
+- (void) preloadViewController:(UIViewController*)controller forSide:(PPRevealSideDirection)direction withOffset:(CGFloat)offset
+{
+ [self preloadViewController:controller
+ forSide:direction
+ withOffset:offset
+ forceRemoval:NO];
+}
+
+- (void) preloadViewController:(UIViewController*)controller forSide:(PPRevealSideDirection)direction withOffset:(CGFloat)offset forceRemoval:(BOOL)force
+{
+ if (direction == [self sideDirectionOpened] && !force) return;
+
UIViewController *existingController = [_viewControllers objectForKey:[NSNumber numberWithInt:direction]];
if (existingController != controller) {
@@ -13,6 +13,7 @@
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "WebViewController.h"
+#import "ModalViewController.h"
@implementation TableViewController
@@ -123,7 +124,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
- return 20;
+ return 24;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
@@ -134,7 +135,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (cell == nil) {
cell = PP_AUTORELEASE([[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]);
}
- switch (indexPath.row % 6) {
+ switch (indexPath.row % 7) {
case 0:
cell.myLabel.text = @"Go to root or push if nav";
break;
@@ -153,6 +154,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
case 5:
cell.myLabel.text = @"Pop Web view center";
break;
+ case 6:
+ cell.myLabel.text = @"Present Modal";
+ break;
default:
break;
}
@@ -204,7 +208,7 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
- switch (indexPath.row % 6) {
+ switch (indexPath.row % 7) {
case 0:
if (self.navigationController) {
ThirdViewController *c = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
@@ -261,6 +265,19 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
PP_RELEASE(n);
}
break;
+ case 6:
+ {
+ ModalViewController *m = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil];
+ UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:m];
+ if (PPSystemVersionGreaterOrEqualThan(5.0))
+ [self presentModalViewController:n animated:YES];
+ else
+ [self.revealSideViewController presentModalViewController:n animated:YES];
+
+ PP_RELEASE(m);
+ PP_RELEASE(n);
+ }
+ break;
default:
break;
}

0 comments on commit a1ca242

Please sign in to comment.