This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface MealPlanScrollView () { | |
NSMutableArray *_dayViews; | |
NSInteger _numberOfDays; | |
NSInteger _viewFirstDateNum; | |
NSInteger _viewLastDateNum; | |
NSInteger _todayDateNum; | |
NSInteger _maxNumberOfDays; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)willTransitionToState:(UITableViewCellStateMask)state { | |
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask) { | |
// ... | |
_showingConfirmation = YES; | |
_cancelDeleteGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(deleteConfirmation:)]; | |
[_table addGestureRecognizer:_cancelDeleteGesture]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)delete:(id)sender { | |
_isDeleting = YES; | |
[self commitEdit:UITableViewCellEditingStyleDelete]; | |
} | |
- (void)commitEdit:(UITableViewCellEditingStyle)editStyle { | |
[self willTransitionToState:UITableViewCellStateShowingEditControlMask]; | |
if ([[_table dataSource] respondsToSelector:@selector(tableView:commitEditingStyle:forRowAtIndexPath:)]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)willTransitionToState:(UITableViewCellStateMask)state { | |
CGRect f; | |
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask) { | |
if (!_deleteButton) { | |
_deleteButton = [MPButton buttonWithType:MPButtonTypeAlert withTitle:NSLocalizedString(@"Delete",@"Delete")]; | |
[[_deleteButton titleLabel] setFont:[[UIFont buttonFont] changeFontSizeBy:-2]]; | |
[_deleteButton addTarget:self action:@selector(delete:) forControlEvents:UIControlEventTouchUpInside]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)willTransitionToState:(UITableViewCellStateMask)state { | |
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask) { | |
} else { | |
[super willTransitionToState:state]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)shouldAutorotate { | |
BOOL autoRotate = YES; | |
for (UIViewController *vc in [self childViewControllers]) { | |
autoRotate = autoRotate && [vc shouldAutorotate]; | |
} | |
return autoRotate; | |
} | |
- (NSUInteger)supportedInterfaceOrientations { | |
NSUInteger supported = IPAD ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskAllButUpsideDown; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UINavigationController (Rotation) | |
// iOS 6 | |
- (BOOL)shouldAutorotate { | |
return [[self topViewController] shouldAutorotate]; | |
} | |
- (NSUInteger)supportedInterfaceOrientations { | |
return [[self topViewController] supportedInterfaceOrientations]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)shouldAutorotate { | |
return IPAD ? YES : NO; | |
} | |
- (NSUInteger)supportedInterfaceOrientations { | |
return IPAD ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIViewController (RBPopoverPrivate) | |
- (UIPopoverController *)hiddenPopoverController { | |
return objc_getAssociatedObject(self, HiddenPopoverControllerKey); | |
} | |
- (void)setHiddenPopoverController:(UIPopoverController *)hiddenPopoverController { | |
objc_setAssociatedObject(self, HiddenPopoverControllerKey, hiddenPopoverController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static char const * const HiddenPopoverControllerKey = "HiddenPopoverController"; | |
static char const * const HiddenPopoverContentKey = "HiddenPopoverContent"; | |
static char const * const HiddenPopoverDelegateKey = "HiddenPopoverDelegate"; | |
static char const * const HiddenPopoverPresentingRectKey = "HiddenPopoverPresentingRect"; | |
static char const * const HiddenPopoverPresentingButtonKey = "HiddenPopoverPresentingButton"; | |
static char const * const HiddenPopoverArrowDirectionKey = "HiddenPopoverArrowDirection"; | |
static char const * const HiddenPopoverAnimatedKey = "HiddenPopoverAnimated"; | |
static char const * const HiddenPopoverContentSizeKey = "HiddenPopoverContentSize"; | |
static char const * const HiddenPopoverHidingInProgessKey = "HiddenPopoverHidingInProgress"; |
NewerOlder