...
Customizing the header can be done to provide more information to the users.
Create a that implments implements
BABFeedHeaderView
.Configure the view through the interface builder or code.
Override
desiredHeight
to specify the height of the desiredheaderView
.Code Block language objective-c // Objective-C @interface CustomHeaderView: BABFeedHeaderView @end @implementation CustomHeaderView + (CGFloat)desiredHeight { return 115.0f; } - (void)loadFromNib { UIView *header = [[UINib nibWithNibName:@"CustomHeaderView" bundle:[NSBundle bundleForClass:[CustomHeaderView class]]] instantiateWithOwner:self options:nil][0]; [self addSubview:header]; } @end
Code Block language swift // Swift class CustomHeaderView: BABFeedHeaderView { override class func desiredHeight() -> CGFloat { return 115.0f } func loadFromNib() { let headerView = Bundle(for: type(of: self)).loadNibNamed("CustomHeaderView", owner: self, options: nil)?.first as! UIView addSubview(headerView) } }
Specify the
headerViewClass
viaBABFeedConfig
.Code Block language objective-c // Objective-C BABFeedConfig *config = [[BABFeedConfig alloc] initWithUnitId:YOUR_FEED_UNIT_ID]; ... config.headerViewClass = [CustomHeaderView class];
Code Block language swift // Swift let config = BABFeedConfig(unitId: YOUR_FEED_UNIT_ID) ... config.headerViewClass = CustomHeaderView.self
...