NewsBlur/clients/ios/Classes/MenuViewController.h
David Sinclair bb4c258b71 iOS: #1201 (show hidden stories)
- Implemented the feature, showing or hiding hidden stories, only offering it if there are some.
- I used the “all” icon in the menu as a placeholder; please provide one you’d prefer.
- Since the crusty old menu mechanism doesn’t handle dynamic items well, I took this opportunity to migrate the feed detail menu to the block-based MenuViewController mechanism, resulting in significant code reduction.
- Enhanced MenuViewController to support the theme controls etc, so other menus can be more easily migrated next time they need to be updated.
2019-06-21 20:09:09 -07:00

29 lines
1.5 KiB
Objective-C

//
// MenuViewController.h
// NewsBlur
//
// Created by David Sinclair on 2016-01-22.
// Copyright © 2016 NewsBlur. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^MenuItemHandler)(void);
typedef void (^MenuItemSegmentedHandler)(NSUInteger selectedIndex);
@interface MenuViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (weak) IBOutlet UITableView *menuTableView;
@property (nonatomic) NSInteger checkedRow;
- (void)addTitle:(NSString *)title iconName:(NSString *)iconName selectionShouldDismiss:(BOOL)selectionShouldDismiss handler:(MenuItemHandler)handler;
- (void)addTitle:(NSString *)title iconName:(NSString *)iconName destructive:(BOOL)isDestructive selectionShouldDismiss:(BOOL)selectionShouldDismiss handler:(MenuItemHandler)handler;
- (void)addTitle:(NSString *)title iconTemplateName:(NSString *)iconTemplateName selectionShouldDismiss:(BOOL)selectionShouldDismiss handler:(MenuItemHandler)handler;
- (void)addSegmentedControlWithTitles:(NSArray *)titles selectIndex:(NSUInteger)selectIndex selectionShouldDismiss:(BOOL)selectionShouldDismiss handler:(MenuItemSegmentedHandler)handler;
- (void)addSegmentedControlWithTitles:(NSArray *)titles values:(NSArray *)values preferenceKey:(NSString *)preferenceKey selectionShouldDismiss:(BOOL)selectionShouldDismiss handler:(MenuItemSegmentedHandler)handler;
- (void)addThemeSegmentedControl;
- (void)showFromNavigationController:(UINavigationController *)navigationController barButtonItem:(UIBarButtonItem *)barButtonItem;
@end