-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRailBackgroundDecorationViewAttributes.swift
More file actions
40 lines (29 loc) · 1.25 KB
/
RailBackgroundDecorationViewAttributes.swift
File metadata and controls
40 lines (29 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// RailBackgroundDecorationViewAttributes.swift
// TenTime
//
// Created by Qamar Al Amassi on 15/07/2024.
//
import UIKit
class RailBackgroundDecorationViewAttributes: UICollectionViewLayoutAttributes, NSMutableCopying {
var backgroundImage: String?
var backgroundColor: UIColor?
var identifier: String?
func mutableCopy(with zone: NSZone? = nil) -> Any {
let copy = super.copy(with: zone) as! RailBackgroundDecorationViewAttributes
copy.backgroundColor = self.backgroundColor
copy.backgroundImage = self.backgroundImage
copy.identifier = self.identifier
print("ATTR 3 ", copy.identifier)
return copy
}
override func isEqual(_ object: Any?) -> Bool {
guard let other = object as? RailBackgroundDecorationViewAttributes else {
return false
}
let areIdentifiersEqual = (self.identifier == other.identifier)
let areBackgroundColorsEqual = (self.backgroundColor == other.backgroundColor)
let areBackgroundImagesEqual = (self.backgroundImage == other.backgroundImage)
return areIdentifiersEqual && areBackgroundColorsEqual && areBackgroundImagesEqual && super.isEqual(object)
}
}