DOPDropDownMenu-Enhanced

DOPDropDownMenu-Enhanced

Source code introduction: On this basis, I beautified the interface, added the application of dual lists, optimized the code, and enhanced the stability. I hope you like it. If you like it, please give it a star;-)

Source code effect:

Source code snippet:

  1. #pragma mark-data source protocol
  2. @class DOPDropDownMenu;
  3.  
  4. @protocol DOPDropDownMenuDataSource <NSObject>
  5.  
  6. @required  
  7.  
  8. /**
  9. * Returns the number of rows in the menu column
  10. */  
  11. - (NSInteger)menu:(DOPDropDownMenu *)menu numberOfRowsInColumn:(NSInteger)column;
  12.  
  13. /**
  14. * Return to menu column column title of each row
  15. */  
  16. - (NSString *)menu:(DOPDropDownMenu *)menu titleForRowAtIndexPath:(DOPIndexPath *)indexPath;
  17.  
  18. @optional  
  19. /**
  20. * Returns how many columns the menu has, 1 column by default
  21. */  
  22. - (NSInteger)numberOfColumnsInMenu:(DOPDropDownMenu *)menu;
  23.  
  24.  
  25. /** New
  26. * When there is a column row, return the number of items. If > 0, it means there is a secondary list. If = 0, there is no secondary list.
  27. * If none of them exists, the protocol can be ignored.
  28. */  
  29. - (NSInteger)menu:(DOPDropDownMenu *)menu numberOfItemsInRow:(NSInteger)row column:(NSInteger)column;
  30.  
  31. /** New
  32. * When there is column row item title
  33. * If none of them exists, the protocol can be ignored.
  34. */  
  35. - (NSString *)menu:(DOPDropDownMenu *)menu titleForItemsInRowAtIndexPath:(DOPIndexPath *)indexPath;
  36. @end  
  37.  
  38. #pragma mark-delegate
  39. @protocol DOPDropDownMenuDelegate <NSObject>
  40. @optional  
  41. /**
  42. * Click agent, clicked the column, row or item, if item >= 0
  43. */  
  44. - ( void )menu:(DOPDropDownMenu *)menu didSelectRowAtIndexPath:(DOPIndexPath *)indexPath;
  45. @end  

Download address: http://download..com/data/2071697

<<:  Implementing dynamic pop-up button effect

>>:  A tough New York designer teaches you the four principles of app design

Recommend

When doing operations, should you work for a big company or a small company?

Each case has undergone in-depth information sear...

Tencent architect teaches you how to write Android specification documents

Preface A qualified code should not only realize ...

Hackers, opponents or users, where does Apple’s interest come from?

Apple continued to appear in court on Wednesday t...