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

Will new media face more difficulties in 2019?

Recently, many friends have asked me: "What ...

The latest spy photos of the new BMW X5 may be unveiled at the end of next year

Recently, overseas media exposed a group of the l...

They produce 20% of Earth's oxygen, but are disappearing

Most life on Earth depends on oxygen to survive. ...

4G Outlook in 2015: FDD licenses will be issued at 1 cent per Mbps

2014 is the year when China officially enters the...

Is it reliable to burn calories with hypoglycemic drugs?

"You don't need to exercise or diet, jus...

7 Top HTML5 Canvas Animations

HTML5 is indeed a new technology that has revolut...

New version of Glance released, a better Android database debugging assistant

[[420558]] This article is reprinted from the WeC...

How to load local video cover in Android

There are many ways to load the cover (usually ca...

Mr. Da Zhou's "Main Behavior Logic Training Camp"

Resource introduction of Mr. Da Zhou's "...