@@ -1548,11 +1548,31 @@ - (void)presentPopoverAsDialogAnimated:(BOOL)aAnimated
15481548 options: WYPopoverAnimationOptionFade];
15491549}
15501550
1551+
1552+ - (void )presentPopoverFromRect : (CGRect)aRect
1553+ inView : (UIView *)aView
1554+ permittedArrowDirections : (WYPopoverArrowDirection)arrowDirections
1555+ animated : (BOOL )aAnimated
1556+ options : (WYPopoverAnimationOptions)aOptions
1557+ {
1558+ [self presentPopoverFromRect: aRect
1559+ inView: aView
1560+ permittedArrowDirections: arrowDirections
1561+ animated: aAnimated
1562+ options: aOptions
1563+ completion: nil ];
1564+ }
1565+
1566+
1567+ // Hsoi 2014-01-24 - Added the 'completion' parameter: adding the parameter, the invocation
1568+ // of it, and the compatiblity version of this method that lacks the 'completion' parameter
1569+ // so existing code can function without change.
15511570- (void )presentPopoverFromRect : (CGRect)aRect
15521571 inView : (UIView *)aView
15531572 permittedArrowDirections : (WYPopoverArrowDirection)arrowDirections
15541573 animated : (BOOL )aAnimated
15551574 options : (WYPopoverAnimationOptions)aOptions
1575+ completion : (void (^)(void ))completion
15561576{
15571577 NSAssert ((arrowDirections != WYPopoverArrowDirectionUnknown), @"WYPopoverArrowDirection must not be UNKNOWN");
15581578
@@ -1650,6 +1670,11 @@ - (void)presentPopoverFromRect:(CGRect)aRect
16501670 {
16511671 [self ->viewController viewDidAppear: YES ];
16521672 }
1673+
1674+ if (completion)
1675+ {
1676+ completion ();
1677+ }
16531678 }];
16541679 }
16551680 else
@@ -1660,6 +1685,11 @@ - (void)presentPopoverFromRect:(CGRect)aRect
16601685 {
16611686 [viewController viewDidAppear: NO ];
16621687 }
1688+
1689+ if (completion)
1690+ {
1691+ completion ();
1692+ }
16631693 }
16641694
16651695 if (isListeningNotifications == NO )
0 commit comments