Files
GitHawk/Classes/Issues/Managing/IssueManagingActionModel.swift
Ryan Nystrom ce80b303b6 MessageViewController update (#1741)
* update action label when value changes, make actions diffable

* Update IGListKit swift branch after rebase

* Update MessageViewController pod

* fix build, update w/ latest fixes
2018-04-21 18:26:45 -04:00

41 lines
996 B
Swift

//
// IssueManagingActionModel.swift
// Freetime
//
// Created by Ryan Nystrom on 11/14/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
import IGListKit
final class IssueManagingActionModel: ListDiffable {
let key: String
let label: String
let imageName: String
let color: UIColor
init(key: String, label: String, imageName: String, color: UIColor) {
self.key = key
self.label = label
self.imageName = imageName
self.color = color
}
// MARK: ListDiffable
func diffIdentifier() -> NSObjectProtocol {
return key as NSObjectProtocol
}
func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
if self === object { return true }
guard let object = object as? IssueManagingActionModel else { return false }
return object.label == label
&& object.imageName == imageName
// skip color, for some reason its a pricy comparison
}
}