javaBin / ems-ios

iOS-app som viser programmet til JavaZone - erstattes fra 2017 med https://github.com/javaBin/appZone
4 stars 0 forks source link

Swipe detail page to move around session list #18

Closed chrissearle closed 11 years ago

chrissearle commented 11 years ago

Given that you're in a detail view - scroll up and down the corresponding list on the list view.

Perhaps a gesture - two finger swipe up and down? Not sure what the webview intercepts.

chrissearle commented 11 years ago

Something similar - intercepts left swipe on a web view

UISwipeGestureRecognizer* leftSwipeRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(someAction)];
leftSwipeRecognizer.numberOfTouchesRequired = 1;
leftSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
leftSwipeRecognizer.cancelsTouchesInView = YES;
[self.webView addGestureRecognizer:leftSwipeRecognizer];
chrissearle commented 11 years ago

UIPageViewController.

Two finger swipe left/right between sessions in a slot. Two finger swipe up/down between slots.

chrissearle commented 11 years ago

We can try to do the following.

Add a UIPageViewController subclass that implements datasource (and maybe delegate).

Initialize it on opening from a table cell with both the fetchedResultsController and indexPath.

Use indexPath current section to set datasource fields.

Configure swiping on details view to send info to the page view controller somehow (we need to distinguish direction - may have enough info by configuring the list of gestures - not sure) - it seems that the list of gesture recognizers comes from the sub UIViews?

Then in the datasource methods - provide view - set indexPath section on swipe up/down and indexPath row on left/right. View nib/class etc initializes by fetching from storyboard. Might be able to configure most of this in the storyboard - not sure.

Also need on pop to send current indexPath back to table view - needs to be scrolled into view (tableView.ScrollToRow(indexPath, UITableViewScrollPosition.Top, true)) or similar

chrissearle commented 11 years ago

Add a page view controller. Implement delegate as before.

Need to call – setViewControllers:direction:animated:completion: to initialize it - pass the first view

On gesture in view - need to trigger page shift. Not entirely sure how to tell UIPVC what plane to shift in.