Just like yesterday's custom cell, you still need to customize a view to show Footerview
Similar content is not discussed, only the different parts are discussed
1. Design the content of the custom tail
There is a new point of knowledge that simulates clicking on the downloaded data from the network, then the button disappears, the display is loading, and then a new cell appears. This time a new function is needed, the code is as follows:
Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (3.0 * nsec_per_sec)), Dispatch_get_main_queue (), ^{
Self.loadMoreBtn.hidden = NO;
Self.loadingView.hidden = YES;
This function means delaying 3 seconds to perform the operation.
2. Set the agent for Footview and make controller the agent of Footview. Notifies the controller to load a new cell when the Footview internal button is clicked. The specific implementation code is as follows:
2.1 First to set the agent Footview, in the. h file: #import <UIKit/UIKit.h>
1. Defining the Proxy protocol
@class Czfootview;
@protocol czfooterviewdelegate <NSObject>
@optional
3.1 Declaring proxy methods
-(void) FOOTERVIEWDIDCLICKEDLOADMOREBTN: (Czfootview *) Footerview;
@end
@interface Czfootview:uiview
2. Defining Proxy Properties
@property (nonatomic, weak) id<czfooterviewdelegate> delegate;
+ (instancetype) Footview;
@end
In the. m file, when the Loadmorebtnclick method sends a message to the agent, it tells the agent to invoke the proxy method. The code is as follows:
2.2 Implementing the Proxy method in the controller's. m file
The actual results are as follows:
12-29 buy the tail of the interface: load more designs