[Spaces] M10.4.1 Home space data filtering #4570

- Improved visual feedback when switching home settings
This commit is contained in:
Gil Eluard
2021-10-11 09:52:21 +02:00
parent b569b65cd7
commit 5b00c5ee3e
5 changed files with 30 additions and 6 deletions
@@ -23,11 +23,30 @@ enum SpaceMenuListItemStyle {
case destructive
}
/// `SpaceMenuListItemViewDataDelegate` allows the table view cell to update its view accordingly with it's related data change
protocol SpaceMenuListItemViewDataDelegate: AnyObject {
func spaceMenuItemValueDidChange(_ item: SpaceMenuListItemViewData)
}
/// `SpaceMenuListViewCell` view data
struct SpaceMenuListItemViewData {
class SpaceMenuListItemViewData {
let actionId: String
let style: SpaceMenuListItemStyle
let title: String?
let icon: UIImage?
var value: Any?
var value: Any? {
didSet {
delegate?.spaceMenuItemValueDidChange(self)
}
}
weak var delegate: SpaceMenuListItemViewDataDelegate?
init(actionId: String, style: SpaceMenuListItemStyle, title: String?, icon: UIImage?, value: Any?) {
self.actionId = actionId
self.style = style
self.title = title
self.icon = icon
self.value = value
}
}