Skip to content

Commit

Permalink
Fix delegate calls on interactive dismissal transitions
Browse files Browse the repository at this point in the history
closes #129

This was a stupid reversed-logic bug. I even tried extracting this to a boolean to keep the logic straight, but something with the "forces non interactive" naming messed with my head, I guess.
  • Loading branch information
cdzombak committed Jan 14, 2016
1 parent ee1f94e commit c0c2040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Pod/Classes/ios/NYTPhotosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ - (void)dismissViewControllerAnimated:(BOOL)animated completion:(void (^)(void))

// Cocoa convention is not to call delegate methods when you do something directly in code,
// so we'll not call delegate methods if this is a programmatic, noninteractive dismissal:
BOOL shouldSendDelegateMessages = self.transitionController.forcesNonInteractiveDismissal;
BOOL shouldSendDelegateMessages = !self.transitionController.forcesNonInteractiveDismissal;

if (shouldSendDelegateMessages && [self.delegate respondsToSelector:@selector(photosViewControllerWillDismiss:)]) {
[self.delegate photosViewControllerWillDismiss:self];
Expand Down

1 comment on commit c0c2040

@eeallen1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks this change fixes the interactive dismissal problem, but now photosViewControllerDidDismiss is not called when I press the X button

Please sign in to comment.