In Bole online to see a very interesting article, oneself also refer to the article realizes a bit.
Effect implementation:
Specific implementation of the content can refer to the original text, reference article: "IOS similar to the United States to sell the app two TableView interactive effect implementation"
First of all, from the interface, it is clear that the UITableview effect of two swipe up and down. The effect of this slide is how the left side is associated with the tableView right side tableView , and the right side after clicking on the left tableView tableview can also slide to the correspondingsection。
Well, after the analysis, we should be clear about our 2 needs:
1. When you click on the left TableViewCell , the right side TableView will follow the slide to the correspondingsection
2. When sliding to the right TableView , the left side TableView will UITableView section slide to the corresponding UITableViewCell position according to the right
But personally, there are a few points that need to be noticed.
1. When setting the right view, the right view is set to the controller, which uses the view frame to achieve this effect. But remember to add a sub-controller on the left side of the controller (the controller on the right view), otherwise it would be easy to make the left view not recognize the click Effect. The benefit of dividing into a single controller is to avoid the confusion caused by the excessive amount of code in a controller.
-(void) setuprightview{ = [[Dlproductcontroller alloc] init]; SELF.PRODUCTVC. delegate = self ; // the current controller must add the product's sub-controller (otherwise there will be click View clutter) [self addChildViewController:self.productVC]; [Self.view AddSubview:self.productVC.view]; }
2. Note that this method is written in the controller on the right
Scrolltorowatindexpath:[nsindexpath indexpathforrow:0 InSection:indexPath.row] Atscrollposition: Uitableviewscrollpositiontop Animated:yes
[Nsindexpath indexpathforrow:0 InSection:indexPath.row] refers to which group the first line (here is the No. 0 row), Indexpath is passed from the Dlcategorycontroller, So what group is the Indexpath.row in this controller?
-(void) Scrolltoselectedindexpath: (Nsindexpath *) indexpath{ // [ Nsindexpath indexpathforrow:0 InSection:indexPath.row] refers to the first line of the group (here is line No. 0), Indexpath is passed from the Dlcategorycontroller, So indexpath.row in this controller is which group [Self.tableview scrolltorowatindexpath:[nsindexpath Indexpathforrow:0 InSection:indexPath.row] atscrollposition:uitableviewscrollpositiontop animated:yes]; }
3. Note that the view on the right is sliding upward and downward. Different proxies are called separately.
IOS similar takeout two tableview linkage