Repeat the TabBar button to refresh the page. Click the status bar to return to the top and the tabbar to return to the top.
1. click the listener button. 2. determine whether the same button is clicked (record the button that was last clicked) 3. when you repeatedly click the same button, you need to obtain the current button corresponding to the Controller refresh interface 3.1 to determine whether to repeatedly click the button. Where is the code written? Click the title button, which belongs to the essence controller, so find the essence controller. In the method of clicking the button, how does one get the Controller corresponding to the button? Through the tag value of the current button, from the sub-controller array of the essence controller 3.3 How to make the corresponding controller refresh the interface? The refresh method is provided in the corresponding controller, so that each controller has to be written. We have extracted the parent class before it is too troublesome. We only need to provide a refresh interface method in the parent class, how does one write a 3.4 refresh interface? ReloadData, this method is not very good, there is no pull-down refresh effect before we provide a pull-down refresh method in the controller, call the pull-down refresh method can be 3.5 pull-down refresh integrated with MJ framework, how to call it?
// Start the pull-down refresh and trigger the pull-down refresh. Call the pull-down refresh method [self. tableView. mj_header beginRefreshing];
3.6 When the controller is loaded for the first time, it also needs to be refreshed. We can manually call the pull-down refresh function in viewDidLoad. repeat tabBar to load data. how does one listen for the 1.1 system button? Set proxy and act as your own proxy. If some methods can only be implemented by yourself as your own proxy, then how can I listen to proxy 1.2?
1 - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
2. determine whether the same TabBar button is clicked (record the last button (Controller) 2.1 define attribute record last selected button (Controller) 2.2 set 0th buttons (Controller) select button (0th buttons are selected by default) 3. obtain the Controller displayed on the current interface. Refresh the Page 3.1 tabBarController and you cannot directly obtain the topic controller. What should I do? 3.2 use notifications. Repeat the tabBar button to send notifications. All topic controllers receive notifications. 3.3 When receiving notifications from the parent controller (topic Controller) of the essence and new posts, self points to the subclass, that is, when the sub-class receives the notification 3.4, when all sub-class controllers are clicked, click the TabBar button, and all sub-controllers receive the notification and refresh the 3.5 page. How can this problem be solved, just let one controller refresh the interface? The subject controller that receives the notification. Only the Controller displayed on the screen (Interface) needs to refresh 3.6. How can I determine whether the controller is displayed on the screen (Interface) through the window attribute, if the Controller's view has the window attribute, it indicates that the current controller is displayed in the window. If not, it is not displayed.
1 // The view of the Controller on the screen must be refreshed. 2 if (self. view. window) {3 // start the pull-down refresh, trigger the pull-down refresh, call the pull-down refresh Method 4 [self. tableView. mj_header beginRefreshing]; 5}3. Click the status bar to return to the top 1. UIScrollView has a feature. clicking the status bar will automatically return to the top 2. Why is this feature available? Because of the scrollsToTop attribute, Apple has an introduction to this attribute (YES by default): In all views currently displayed, if the scrollsToTop attribute of multiple scrollviews is enabled, no effect. Only one scrollView on the screen can open scrollsToTop. how can we make our theme controller also have: Click the status bar to automatically return to the top? You can set the scrollsToTop attribute of collectionView and scrollView (Title button bar) to NO in the parent controller of Essence and new posts by setting scrollsToTop = YES of topic controller.