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

Qvod will release boxes and smart TVs and is in contact with content providers

[September 10 news] It is understood that Qvod wi...

How does Ele.me manage product operations with low ROI?

"Free fruit" is a classic operation pro...

Why is criticism more memorable than praise?

© Frederic Cirou/Getty Images Leviathan Press: Re...

AR Technology Part 2: Visiting the Hefei Advanced Light Source

The Hefei Advanced Light Source (HALF) is a fourt...

King crabs are rampant. Is eating them saving the ecology?

As the saying goes, "scarcity makes things v...

How to create a short video with a mobile phone?

How to make a card-point video with a mobile phon...

With these five things, your hardware can also become "smart"

For most people, "smart" is not a very ...

2-year-old boy found 6 live worms in his eyes! Change these habits now...

Expert in this article: Li Mingwu, Chief Physicia...

Fuwei "Souwai Mini Program Learning Community" (41 video courses in total)

Chapter 1: Registering a Mini Program (Main Busin...

Today, to all the parents at home! Please share "A loving family"

Expert in this article: Yang Jing, PhD in Immunol...

What is NATO? What is the feud between NATO and Russia?

Mixed Knowledge Specially designed to cure confus...

"Happy Candy Crush" APP Operation Analysis

Happy Match 3 is a strategy game developed by Ten...

Lao Duan said: The future of cable network is integrated TV

After the launch of iQiyi Ultra HD Box and TCL iQ...

Pig: Lazy and gluttonous? God knows I have a high IQ.

I am Dong Dong Meow Talking animals are so fun! T...