0

Hasher.combine fails with compile error: Error:(31, 24) Missing argument label 'bytes:' in call when I try to pass a string. Here is the code:

private class AssetCacheKey : NSObject {
    let id: String
    let size: CGSize

    init(id: String, size: CGSize) {
        self.id = id
        self.size = size
    }

    private func isEqual(_ other: AssetCacheKey) -> Bool {
        return other.id == id && other.size == size
    }

    override func isEqual(_ object: Any?) -> Bool {
        return (object as? AssetCacheKey)?.isEqual(self) ?? false
    }

    override class func hash() -> Int {
        var hasher = Hasher()
        hasher.combine(id)
        //hasher.combine(size)
        return hasher.finalize()
    }
}
Semyon Tikhonenko
  • 3,872
  • 6
  • 36
  • 61

0 Answers0