Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: cache clean up #15

Merged
merged 11 commits into from
Dec 3, 2015
Merged

Feature: cache clean up #15

merged 11 commits into from
Dec 3, 2015

Conversation

vadymmarkov
Copy link
Contributor

@zenangst @RamonGilabert
Now we clear expired cache items when the application on of those notifications:

  1. UIApplicationDidReceiveMemoryWarningNotification
  2. UIApplicationWillTerminateNotification
  3. UIApplicationDidEnterBackgroundNotification

screen shot 2015-11-20 at 12 30 52

notificationCenter.addObserver(self, selector: "applicationWillTerminate",
name: UIApplicationWillTerminateNotification, object: nil)
notificationCenter.addObserver(self, selector: "applicationDidEnterBackground",
name: UIApplicationDidEnterBackgroundNotification, object: nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove these notifications at any time?

let time1 = ($0.resourceValues[NSURLContentModificationDateKey] as? NSDate)?.timeIntervalSince1970
let time2 = ($1.resourceValues[NSURLContentModificationDateKey] as? NSDate)?.timeIntervalSince1970
return time1 > time2
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove ()

zenangst added a commit that referenced this pull request Dec 3, 2015
@zenangst zenangst merged commit d30fb21 into master Dec 3, 2015
@zenangst zenangst deleted the feature/cache-clean-up branch December 3, 2015 16:09
@pmiotto pmiotto mentioned this pull request Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants