danielsaidi / Sheeeeeeeeet

Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
MIT License
1.72k stars 109 forks source link

Decouple MenuItem from ActionSheetItemCell #101

Closed danielsaidi closed 4 years ago

danielsaidi commented 4 years ago

Today, the MenuItem and its subclasses know about ActionSheetItemCell, in order for an action sheet to convert menu items to cells.

This should not be the case, since the Menu namespace should be independent from any usages. For instance, I would like to be able to create a separate MenuKit library, that does not know anything about custom action sheets.

danielsaidi commented 4 years ago

To achieve this, I had to make CustomItem and CollectionItem non-generic and create the mapping function as @obj extensions, which allows for overrides.

This can be tested in 3.0.0-beta.