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

How to completely deal with broken links on a website?

If there are broken links on the website, they mu...

Solid info! Tips for writing information flow copy!

I worry about writing creative ideas every day Ho...

Make a stylish headphone Beats new Solo2 review

Apple's $3 billion acquisition of Beats has be...

Is there any pattern in the arrangement of galaxies, fractal or random?

Where do galaxies change and is there any pattern...

Why is Typhoon Prasang moving so fast? Will it be the heat terminator?

Zhejiang Weather released the latest news at 11:0...

Toutiao Nanny-level Marketing Promotion Strategy

Recently, when I was providing marketing consulti...

Dark matter accounts for 85% of the universe, so why can't we find it?

The author or source of this article or its origi...

Manhole covers "eat people" again? Safety under your feet cannot be ignored!

Around 21:00 on May 12, a 3-year-old boy accident...

Don't eat it! It has 3,000 to 6,000 parasites in its body.

As the temperature rises In parks, wetlands, pond...