79488940

Date: 2025-03-06 10:08:28
Score: 1.5
Natty:
Report link

I'm creating a custom tab bar class and ensuring it runs smoothly on iOS 15+. I've also added compatibility for iPads on iOS 18 to override the trait collection when needed. The following code is placed inside viewDidLoad and works without issues

if #available(iOS 18, *), UIDevice.current.userInterfaceIdiom == .pad { setOverrideTraitCollection( UITraitCollection(horizontalSizeClass: .compact), forChild: self ) }

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Aryan Rawat