Hi, I have the following case, I need to add a label in one of the tabs (which should be placed above the title label) with the number of requests (for example, +9). I made a class inheriting from ButtonBarViewCell, but the changes do not occur. How can I make it? Thanks.
class FriendsPagerViewController: ButtonBarPagerTabStripViewController {
/// MARK: - Data
// MARK: - Lifecycle
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = .white
settings.style.buttonBarItemBackgroundColor = .white
settings.style.selectedBarBackgroundColor = ColorManager.mainOrange
let fontManager = FontManager()
settings.style.buttonBarItemFont = fontManager.font(.RobotoCondensed_Regular, size: 16) ?? .boldSystemFont(ofSize: 14)
settings.style.selectedBarHeight = 2.0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
settings.style.buttonBarLeftContentInset = 0
settings.style.buttonBarRightContentInset = 0
changeCurrentIndexProgressive = { (oldCell: FriendsButtonBarViewCell?, newCell: FriendsButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = .black
newCell?.label.textColor = ColorManager.mainOrange
} as? ((ButtonBarViewCell?, ButtonBarViewCell?, CGFloat, Bool, Bool) -> Void)
containerView?.isScrollEnabled = false
super.viewDidLoad()
}
}

I am encountering the same issue.
Hi @alexsanderkhitev
There is no way to set a subclass of ButtonBarViewCell to a ButtonBarPagerTabStripViewController. In order to provide a custom cell, the ButtonBarPagerTabStripViewController exists
In order to use your custom cell for the ButtonBarPagerTabStripViewController, you should be inheriting from BaseButtonBarPagerTabStripViewController<ButtonBarCellType : UICollectionViewCell>. The ButtonBarCellType would be your custom cell. You'll have to override some especific methods, such as func configure to configure the cell.
Please check the YoutubeExampleViewController in the example project to check out more in deep how it is implemented.
Hope it helps! Regards,
Hi @fedeojeda95
Thank you so much for your response!
Hi @alexsanderkhitev
There is no way to set a subclass of
ButtonBarViewCellto aButtonBarPagerTabStripViewController. In order to provide a custom cell, theButtonBarPagerTabStripViewControllerexistsIn order to use your custom cell for the
ButtonBarPagerTabStripViewController, you should be inheriting fromBaseButtonBarPagerTabStripViewController<ButtonBarCellType : UICollectionViewCell>. The ButtonBarCellType would be your custom cell. You'll have to override some especific methods, such asfunc configureto configure the cell.Please check the
YoutubeExampleViewControllerin the example project to check out more in deep how it is implemented.Hope it helps! Regards,
Hi, After inheriting from BaseButtonBarPagerTabStripViewController
Most helpful comment
Hi @alexsanderkhitev
There is no way to set a subclass of
ButtonBarViewCellto aButtonBarPagerTabStripViewController. In order to provide a custom cell, theButtonBarPagerTabStripViewControllerexistsIn order to use your custom cell for the
ButtonBarPagerTabStripViewController, you should be inheriting fromBaseButtonBarPagerTabStripViewController<ButtonBarCellType : UICollectionViewCell>. The ButtonBarCellType would be your custom cell. You'll have to override some especific methods, such asfunc configureto configure the cell.Please check the
YoutubeExampleViewControllerin the example project to check out more in deep how it is implemented.Hope it helps! Regards,