IOS to achieve the stock, curriculum, Excel, such as up and down sliding effect (fixed on the left column, the right side can slide up and down), this paper uses a single UITableView implementation

First of all, it is embarrassing, lost Tucao: this rookie does not know how to upload GIF, so the results can only be described with a simple picture.

First simple description of requirements:
1, the most common stock effect, left and right sliding, rolling up and down.
2, the effect of the course table, fixed on the left section of the class, the right is Monday to Sunday of the course, you can slide left and right.
3, business applications App, the realization of the calculation of income sliding around, similar to the Excel form.

That is: to achieve a list, the left column fixed, the right side can slide up and down, focusing on the head can also slide along with sliding.

IOS to achieve the stock, curriculum, Excel, such as up and down sliding effect (fixed on the left column, the right side can slide up and down), this paper uses a single UITableView implementation
1: any layout you want to view, 2: up the slide when suspended in the top, the 3: to achieve left and right sliding
IOS to achieve the stock, curriculum, Excel, such as up and down sliding effect (fixed on the left column, the right side can slide up and down), this paper uses a single UITableView implementation
renderings
IOS to achieve the stock, curriculum, Excel, such as up and down sliding effect (fixed on the left column, the right side can slide up and down), this paper uses a single UITableView implementation
up 2 suspension in the top

What nonsense:

1: online you can see is (mostly) are implemented with two UITableView+UIScrollView.
so that the first picture of the 1 view is difficult to achieve, not to follow the slide and slide. You also want to tangle how to fall refresh, pull more load.

2: the realization of the two UITableView is probably the case: the name of the column is a UITableView code, the latter values are a UITableView. Of course, the suspension in the top of the line is the realization of UIScrollView, and so is mine

3: knock code, see more and more contrast, is his own things, but also to know where the problem.


Implementation ideas:

IOS to achieve the stock, curriculum, Excel, such as up and down sliding effect (fixed on the left column, the right side can slide up and down), this paper uses a single UITableView implementation
layout

The problem is:
1: sliding cell UIScrollView, how to achieve all of the following cell sliding around, as well as the latest price that line is also sliding?

2: the latest price in the slide, then the following content view cell, why also follow the left and right slide?

The rookie pondering for a long time, and finally achieved with the notification, the following direct paste the key code,
truth is: I am in the slide, you have to inform the slide. Then it was realized

/ / register a notification in the controller, the purpose is / / I slid, issued a notice to tell each other will follow the [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector Journal (scrollMove: name:tapCellScrollNotification object:nil]);

Proxy method of UIScrollView in controller

- (void) scrollViewDidScroll: (UIScrollView * scrollView) {//cell UIScrollView on viewForHeader UIScrollView with sliding sliding if ([scrollView isEqual:self.topScrollView]) {CGPoint offSet = _aroundCell.rightScrollView.contentOffset; offSet.x = scrollView.contentOffset.x; _aroundCell.rightScrollView.contentOffset = offSet;} //viewForHeader UIScrollView slide, issued a notice on the cell UIScrollView to tell if ([scrollView slide isEqual:self.myTableView] sent [[NSNotificationCenter defaultCenter]) {/ / postNotificationName:tapCellScrollNotification object:self userInfo:@{@ "cellOffX": @}] (self.cellLastX);}}

How much does the cell method of
, the number of viewForHeader slides, slide along with the notification

- (void) scrollMove: (NSNotification*) notification *noticeInfo NSObject {NSDictionary = notification.userInfo; *obj = notification.object; float = x [noticeInfo[@ "cellOffX" floatValue]; self.cellLastX = x; CGPoint offSet = self.topScrollView.contentOffset; offSet.x = x; self.topScrollView.contentOffset = offSet; obj = nil;}

The next step is to deal with cell

/ / add a click event to give cell, UIScrollView registration notice (notice to a controller with UITapGestureRecognizer *tapGes [[UITapGestureRecognizer alloc] all) = initWithTarget:self action:@selector (tapAction:)]; [self.rightScrollView addGestureRecognizer:tapGes]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (scrollMove:) name:tapCellScrollNotification object:nil];

UIScrollView proxy events in //cell

- (void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView{if (! _isNotification) {/ / [[NSNotificationCenter defaultCenter] postNotificationName:tapCellScrollNotification object:self userInfo:@{@ send notification "cellOffX": @ (scrollView.contentOffset.x)}]}; _isNotification = NO;}

We just added an event to cell’s UIScrollView, which was to tell the controller that I clicked on the first line, and the controller did other actions.
and we’re worried that his trigger is in conflict with other triggers, and I’m going to make a gesture to judge whether we add it or UITableViewCellContentView

- (void) tapAction: (UITapGestureRecognizer *) gesture if (self.tapCellClick) {{self.tapCellClick}}; (indexPath) - (BOOL) gestureRecognizer: (UIGestureRecognizer * gestureRecognizer) shouldReceiveTouch: (UITouch * touch) {if ([NSStringFromClass ([touch.view class]) isEqualToString:@ "UITableViewCellContentView"]) {return NO}; return YES;}

Probably the train of thought and the important code above.
or sentence: knock code, see more and more contrast, is his own things, but also to know where the problem.
if you do not understand what, welcome to study together, encourage each other.
Demo download address, welcome stars –> AroundVC
welcome great God exhibitions, thank you very much, thank you.