Apple says:
Depending on the device and orientation, the system displays either a regular or compact tab bar. Your app should include custom tab bar i
TLDR: You can specify different icons for regular or compact tab bar in Asset Catalog by setting Width Class to Any & Compact.
Yes, according to Human Interface Guidelines Custom Icons - Tab Bar Icon Size you should include both icon sizes
In portrait orientation, tab bar icons appear above tab titles¹. In landscape orientation, the icons and titles appear side-by-side.
¹⁾ This is true only on iPhone. On iPad for full-screen apps the icons and titles appear side-by-side in both portrait and landscape orientations.
Depending on the device and orientation, the system displays either a regular or compact tab bar. Your app should include custom tab bar icons for both sizes.
The guidelines are talking about Size Classes. In this case regular or compact tab bar means tab bar in regular or compact width size class.
You can specify different images for different size classes in the asset catalog. Just set Width class to Any & Compact
in the Attributes Inspector for you tab bar icon Image Set:
Set the larger images for regular size class in the Any Width section and smaller images for compact size class in Compact Width section.
The system will then automatically show the correct image according to the size class (device, orientation, multitasking configuration).
You can find the correct icon sizes for the icons in Human Interface Guidelines Custom Icons - Tab Bar Icon Size.
For example for a circular glyph the icon should be:
For a square glyph the icon should be:
There are additional sizes for wide glyphs and tall glyphs.
In the screenshot above I use PDF images with Scale set to Single Scale
in the Attributes Inspector. The system automatically generates 1x, 2x and 3x PNGs.
You should not do this yourself system can do it automatically.
here is Apple Human Interface Guidelines, where you can find icon resolutions: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/custom-icons/
for example: If you are using circular icons for tab bar item you should create following sizes for portrait mode:
and for landscape mode:
after you add this icons into Assets.xcassets or somewhere, you can select Tab Bar Item icons from storyboard:
select Tab Bar item and in the attributes inspector, choose portrait image for image field, and landscape image for landscape field.
After that system will do everything for you.
Unfortunately, the compact/regular state does not only depend from the orientation or the app window size, it also depends on the device.
You can find a regular/compact size breakdown here for different devices. You should look for the second value (for e.g. Compact width, regular height).
The change happens between the two types of icons automatically, as soon as the orientation/app window changes.