TIMOB-14622 (3_1_X) IOS windows refactor

Backport of PR #4569 for 3_1_X