Using UIDesignRequiresCompatibility for tabbar which is having issue with liquid glass. Initially tabbar loads it shows 5 tabs instead of 6
Using UIDesignRequiresCompatibility to have backward compatibility with 6 tabs based TabbarController using traitCollection. but the issue is initially loads 5 tabs & when app goes to background & then comes to foreground then it load 6 tabs. when I kill app then again shows 5 tabs. I want to load 6 tabs every time. How to fix this issue.
code we are using for 6 tabs.
- (UITraitCollection *)traitCollection {
UITraitCollection *realTraits = [super traitCollection];
BOOL shouldOverride = (self.viewControllers.count == 6);
NSArray *traits = shouldOverride
? @[realTraits, [UITraitCollection traitCollectionWithHorizontalSizeClass:UIUserInterfaceSizeClassRegular]]
: @[realTraits];
return [UITraitCollection traitCollectionWithTraitsFrom]()