Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added previewBounceLeftView and previewBounceRightView methods, tied …

…to "bounce" buttons on the nav bar.
  • Loading branch information...
commit 9083b36c1762a42afdb4615bd6c7ffa836cb51d8 1 parent b706408
@cbpowell cbpowell authored
View
8 ViewDeckExample/RightViewController.m
@@ -150,6 +150,14 @@ - (void)viewDeckController:(IIViewDeckController *)viewDeckController didShowCen
[self addLog:[NSString stringWithFormat:@"did show center view from %@", NSStringFromIIViewDeckSide(viewDeckSide)]];
}
+- (void)viewDeckController:(IIViewDeckController *)viewDeckController willPreviewBounceViewSide:(IIViewDeckSide)viewDeckSide animated:(BOOL)animated {
+ [self addLog:[NSString stringWithFormat:@"will preview bounce %@ view", NSStringFromIIViewDeckSide(viewDeckSide)]];
+}
+
+- (void)viewDeckController:(IIViewDeckController *)viewDeckController didPreviewBounceViewSide:(IIViewDeckSide)viewDeckSide animated:(BOOL)animated {
+ [self addLog:[NSString stringWithFormat:@"did preview bounce %@ view", NSStringFromIIViewDeckSide(viewDeckSide)]];
+}
+
#pragma mark - Table view
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
View
26 ViewDeckExample/ViewController.m
@@ -39,9 +39,19 @@ - (void)viewDidLoad
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleLeftView)];
+ if ([self.navigationItem respondsToSelector:@selector(leftBarButtonItems)]) {
+ self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:
+ [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleLeftView)],
+ [[UIBarButtonItem alloc] initWithTitle:@"bounce" style:UIBarButtonItemStyleBordered target:self action:@selector(previewBounceLeftView)],
+ nil];
+ } else {
+ self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleLeftView)];
+ }
+
if ([self.navigationItem respondsToSelector:@selector(rightBarButtonItems)]) {
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc] initWithTitle:@"right" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleRightView)],
+ [[UIBarButtonItem alloc] initWithTitle:@"bounce" style:UIBarButtonItemStyleBordered target:self action:@selector(previewBounceRightView)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:@selector(showCam:)],
nil];
}
@@ -83,6 +93,22 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return YES;
}
+- (void)previewBounceLeftView {
+ [self.viewDeckController previewBounceView:IIViewDeckLeftSide];
+}
+
+- (void)previewBounceRightView {
+ [self.viewDeckController previewBounceView:IIViewDeckRightSide];
+}
+
+- (void)previewBounceTopView {
+ [self.viewDeckController previewBounceView:IIViewDeckTopSide];
+}
+
+- (void)previewBounceBottomView {
+ [self.viewDeckController previewBounceView:IIViewDeckBottomSide];
+}
+
- (void)showCam:(id)sender {
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
Please sign in to comment.
Something went wrong with that request. Please try again.