Skip to content

Commit

Permalink
Convert to forced conversion syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
klaaspieter committed Mar 11, 2015
1 parent d5a7154 commit f9dd52f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions AwesomeCache/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Cache<T: NSCoding> {
if let d = directory {
cacheDirectory = d
} else {
let dir = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true).first as String
let dir = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true).first as! String
cacheDirectory = dir.stringByAppendingFormat("/com.aschuch.cache/%@", name)
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public class Cache<T: NSCoding> {
cache.removeAllObjects()

dispatch_async(diskQueue) {
let paths = self.fileManager.contentsOfDirectoryAtPath(self.cacheDirectory, error: nil) as [String]
let paths = self.fileManager.contentsOfDirectoryAtPath(self.cacheDirectory, error: nil) as! [String]
let keys = paths.map { $0.stringByDeletingPathExtension }

for key in keys {
Expand All @@ -222,7 +222,7 @@ public class Cache<T: NSCoding> {
*/
public func removeExpiredObjects() {
dispatch_async(diskQueue) {
let paths = self.fileManager.contentsOfDirectoryAtPath(self.cacheDirectory, error: nil) as [String]
let paths = self.fileManager.contentsOfDirectoryAtPath(self.cacheDirectory, error: nil) as! [String]
let keys = paths.map { $0.stringByDeletingPathExtension }

for key in keys {
Expand Down Expand Up @@ -258,7 +258,7 @@ public class Cache<T: NSCoding> {
private func expiryDateForCacheExpiry(expiry: CacheExpiry) -> NSDate {
switch expiry {
case .Never:
return NSDate.distantFuture() as NSDate
return NSDate.distantFuture() as! NSDate
case .Seconds(let seconds):
return NSDate().dateByAddingTimeInterval(seconds)
case .Date(let date):
Expand Down
2 changes: 1 addition & 1 deletion AwesomeCache/CacheObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CacheObject : NSObject, NSCoding {

required init(coder aDecoder: NSCoder) {
value = aDecoder.decodeObjectForKey("value") as AnyObject!
expiryDate = aDecoder.decodeObjectForKey("expiryDate") as NSDate
expiryDate = aDecoder.decodeObjectForKey("expiryDate") as! NSDate

super.init()
}
Expand Down

0 comments on commit f9dd52f

Please sign in to comment.