I am having a native app, in which I have to show Share feature with UIActivityViewController. My app needs to support both orientations. When the share pops up and I change the device orientation, then the orientation for popup changes but the background screen remains its orientation and when I cancel it out then the background screen looks messy.
Please let me know how to fix this as my app is in release phase and I am stuck with this issue.
NSString *textToShare = @"your text";
NSArray *itemsToShare = @[textToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll];
[activityVC setCompletionHandler:^(NSString *activityType, BOOL completed){
IsAppLoadedFirstTime=false;
[infoImageabc1 removeFromSuperview];
[InfoLabel1 removeFromSuperview];
[ InfoLabel2 removeFromSuperview];
[InfoShare removeFromSuperview];
[self loadView];
}];
[self presentViewController:activityVC animated:YES completion:nil];
I can change the orientation as soon as the activity popup closes, but before the (when the popup is opened), then the UI is not in proper orientation say if after opening the popup I changed the orientation to Portrait, then my UI remains in Landscape mode, but as it includes text also, so UI looks bad.