On loadView, original code was getting size for composeViewController from window.rootViewController. Changed it to get current screen size for interface orientation. Getting size from rootViewContoller was creating issues when rootViewController was presenting another view and rotation