When I present my modal view using the UIModalPresentationFormSheet style it centers correctly, but when the keyboard appears (a second after), instead of moving the modal view up vertically it moves it either to the left or to the right, almost as if it thought it were in portrait mode. If I rotate my device, it fixes itself to the correct orientation.
The app is set to landscape only but I can't figure out the issue.
What's wrong here?
I am displaying my view using the following method:
- (void)presentEventEditViewControllerWithEventStore:(EKEventStore*)eventStore {
EKEventEditViewController *evc = [[EKEventEditViewController alloc] init];
evc.eventStore = eventStore;
EKEvent* event = [EKEvent eventWithEventStore:eventStore];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"MM.dd.yyyy"];
NSString *startDate = @"11.01.2014";
NSString *endDate = @"11.07.2014";
//Pre-populated Info
event.startDate = [dateFormatter dateFromString:startDate];
event.endDate = [dateFormatter dateFromString:endDate];
event.allDay = YES;
event.location = @"The Big Island, Hawaii";
event.availability = EKEventAvailabilityBusy;
evc.event = event;
evc.editViewDelegate = self;
evc.delegate = self;
evc.modalPresentationStyle = UIModalPresentationFormSheet;
evc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:evc animated:YES completion:nil];
}