mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
624 B
Swift
18 lines
624 B
Swift
5 years ago
|
|
||
|
extension Storage {
|
||
|
|
||
|
static let volumeSamplesCollection = "LokiVolumeSamplesCollection"
|
||
|
|
||
|
static func getVolumeSamples(for attachment: String) -> [Float]? {
|
||
|
var result: [Float]?
|
||
|
read { transaction in
|
||
|
result = transaction.object(forKey: attachment, inCollection: volumeSamplesCollection) as? [Float]
|
||
|
}
|
||
|
return result
|
||
|
}
|
||
|
|
||
|
static func setVolumeSamples(for attachment: String, to volumeSamples: [Float], using transaction: YapDatabaseReadWriteTransaction) {
|
||
|
transaction.setObject(volumeSamples, forKey: attachment, inCollection: volumeSamplesCollection)
|
||
|
}
|
||
|
}
|