Suppose an iOS app displays an item that, when clicked, brings up an action menu for that item (for example, UIActionSheet). A trap consists of many elements that can be clicked, such as this one, can be present in every view of the application, so the action menu and its delegates must also be processed in any situation.
For example, an item that can be clicked can be a photograph of a product (UIButton with an image background) that can be displayed on many different screens, and when you click on a user, options such as Buy, Details, etc. .d.
How would you like to design / implement this kind of component with its associated behavior, in a modular and reusable way?
It is important to keep the function in a stand-alone set of classes that can be easily tested separately and turned on / off when necessary, and you do not need to insert code into each controller where this function can be used.
Thanks!
source share