PulldownMenu.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // PulldownMenu.h
  3. //
  4. // Created by Bernard Gatt
  5. //
  6. #import <UIKit/UIKit.h>
  7. @protocol PulldownMenuDelegate
  8. -(void)menuItemSelected:(NSIndexPath *)indexPath;
  9. -(void)pullDownAnimated:(BOOL)open;
  10. @end
  11. @interface PulldownMenu : UIView<UITableViewDataSource, UITableViewDelegate> {
  12. UITableView *menuList;
  13. NSMutableArray *menuItems;
  14. UIView *handle;
  15. UIView *masterView;
  16. UIPanGestureRecognizer *navigationDragGestureRecognizer;
  17. UIPanGestureRecognizer *handleDragGestureRecognizer;
  18. UINavigationController *masterNavigationController;
  19. UIDeviceOrientation currentOrientation;
  20. float topMargin;
  21. float tableHeight;
  22. }
  23. @property (nonatomic, assign) id<PulldownMenuDelegate> delegate;
  24. @property (nonatomic, retain) UITableView *menuList;
  25. @property (nonatomic, retain) UIView *handle;
  26. /* Appearance Properties */
  27. @property (nonatomic) float handleHeight;
  28. @property (nonatomic) float animationDuration;
  29. @property (nonatomic) float topMarginPortrait;
  30. @property (nonatomic) float topMarginLandscape;
  31. @property (nonatomic) UIColor *cellColor;
  32. @property (nonatomic) UIColor *cellSelectedColor;
  33. @property (nonatomic) UIColor *cellTextColor;
  34. @property (nonatomic) UITableViewCellSelectionStyle cellSelectionStyle;
  35. @property (nonatomic) UIFont *cellFont;
  36. @property (nonatomic) float cellHeight;
  37. @property (nonatomic) BOOL fullyOpen;
  38. - (id)initWithNavigationController:(UINavigationController *)navigationController;
  39. - (id)initWithView:(UIView *)view;
  40. - (void)insertButton:(NSString *)title;
  41. - (void)loadMenu;
  42. - (void)animateDropDown;
  43. - (void)animateDropDown:(CGPoint)position;
  44. @end