    private let userDefaults = UserDefaults.standard

    func addArrayData(data: Data, key: String) {
        guard var persisted = self.arrayDataByKey(key: key) else {
            return userDefaults.set([data], forKey: key)
        }
        persisted.append(data)
        userDefaults.set(persisted, forKey: key)