mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-22 23:42:50 +08:00
35 lines
713 B
Swift
35 lines
713 B
Swift
//
|
|
// Label.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 6/2/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import IGListKit
|
|
|
|
final class RepositoryLabel: ListDiffable {
|
|
|
|
let color: String
|
|
let name: String
|
|
|
|
init(color: String, name: String) {
|
|
self.color = color
|
|
self.name = name
|
|
}
|
|
|
|
// MARK: ListDiffable
|
|
|
|
func diffIdentifier() -> NSObjectProtocol {
|
|
return name as NSObjectProtocol
|
|
}
|
|
|
|
func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
|
|
if self === object { return true }
|
|
guard let object = object as? RepositoryLabel else { return false }
|
|
return color == object.color
|
|
}
|
|
|
|
}
|