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
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.