Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visible CGRect is wrong when creating event #86

Open
zhjuncai opened this issue Apr 7, 2017 · 3 comments
Open

visible CGRect is wrong when creating event #86

zhjuncai opened this issue Apr 7, 2017 · 3 comments

Comments

@zhjuncai
Copy link

zhjuncai commented Apr 7, 2017

Hi,

I love this Calendar library. Today I found out that when creating an event, the popover position is wrong.

If I long tap the evening date, the popover even invisible and press ESC to continue

Device: Simulator
Version: master branch

- (void)showPopoverForNewEvent:(EKEvent*)ev
{
    EKEventEditViewController *eventController = [EKEventEditViewController new];
    eventController.event = ev;
    eventController.eventStore = self.eventStore;
    eventController.editViewDelegate = self; // called only when event is deleted
    eventController.modalInPopover = YES;
    eventController.modalPresentationStyle = UIModalPresentationPopover;
    eventController.presentationController.delegate = self;
    
    [self showDetailViewController:eventController sender:self];
    
    CGRect cellRect = [self.dayPlannerView rectForNewEventOfType:self.createdEventType atDate:self.createdEventDate];
    CGRect visibleRect = CGRectIntersection(self.dayPlannerView.bounds, cellRect);

    UIPopoverPresentationController *popController = eventController.popoverPresentationController;
    popController.permittedArrowDirections = UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionRight;
    popController.delegate = self;
    popController.sourceView = self.dayPlannerView;
    popController.sourceRect = visibleRect;
}
@zhjuncai
Copy link
Author

zhjuncai commented Apr 8, 2017

screen shot 2017-04-07 at 10 11 05 pm

see the small white triangle always points to 01:30 which is obvious wrong, no matter when the event was created

@zhjuncai
Copy link
Author

hmmm... anyone had solved this issue?

@zhjuncai
Copy link
Author

I known what went wrong. Will do a pull request soon

zhjuncai added a commit to zhjuncai/Calendar that referenced this issue May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant