40 lines
1.0 KiB
Swift
40 lines
1.0 KiB
Swift
//
|
|
// CommonModelMenu.swift
|
|
// Wallet
|
|
//
|
|
// Created by Igor on 11.02.2021.
|
|
// Copyright © 2021 AM. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension Common.Model {
|
|
struct Menu {
|
|
let uuid: String
|
|
let image: UIImage?
|
|
let imageURLs: [URL]?
|
|
let title: String
|
|
var text: String?
|
|
let details: String?
|
|
var badge: (String, UIColor)?
|
|
let action: (() -> Void)?
|
|
}
|
|
}
|
|
|
|
extension Common.Model.Menu: Equatable {
|
|
static func == (lhs: Self, rhs: Self) -> Bool { lhs.uuid == rhs.uuid }
|
|
}
|
|
|
|
extension Common.Model.Menu {
|
|
static func menu(
|
|
uuid: String = UUID().uuidString,
|
|
image: UIImage? = nil,
|
|
imageURLs: [URL]? = nil,
|
|
title: String = "",
|
|
text: String? = nil,
|
|
details: String? = nil,
|
|
badge: (String, UIColor)? = nil,
|
|
action: (() -> Void)? = nil
|
|
) -> Common.Model.Menu { .init(uuid: uuid, image: image, imageURLs: imageURLs, title: title, text: text, details: details, badge: badge, action: action) }
|
|
}
|