Files
hyperoslo-Cache/Source/Shared/Extensions/NSData+Cache.swift
T
2016-05-23 10:11:43 +02:00

30 lines
492 B
Swift

import Foundation
// MARK: - Cachable
/**
Implementation of Cachable protocol.
*/
extension NSData: Cachable {
public typealias CacheType = NSData
/**
Creates an instance from NSData
- Parameter data: Data to decode from
- Returns: An optional CacheType
*/
public static func decode(data: NSData) -> CacheType? {
return data
}
/**
Encodes an instance to NSData
- Returns: Optional NSData
*/
public func encode() -> NSData? {
return self
}
}