-
Notifications
You must be signed in to change notification settings - Fork 1
ContentManager
James Barrow edited this page Jan 29, 2017
·
4 revisions
The Content Manager is a class that checks all content saved into local storage. It tracks when they were added/accessed from LocalStorage or ImageCache. If an item has not been accessed in 2 weeks (by default) they will be automatically deleted on launch.
Declaration
Swift
private lazy var contentMetadata = String: Date
---
<br>
### maxSavedTimeInSeconds
**Declaration**
> <sub>**Swift**</sub>
> ```swift
private static var maxSavedTimeInSeconds: TimeInterval
## Singleton
The shared content manager object.
Declaration
Swift
public static let shared = ContentManager()
---
<br>
## Content Management Methods <br>
### checkContentMetadata()
Checks though all of the managed content metadata. If an item has not been accessed for more than 2 weeks then it is removed from the local storage.
**Declaration**
> <sub>**Swift**</sub>
> ```swift
public class func checkContentMetadata()
Creates or updates metadata for an object at an absolute URL.
Declaration
Swift
public class func save(url: URL)
**Parameters**
<table>
<tr><td> `url` </td><td> The absolute URL of the item. </td></tr>
<table>
---
<br>
### save(path:)
Creates or updates metadata for an object at an absolute path.
**Declaration**
> <sub>**Swift**</sub>
> ```swift
public class func save(path: String)
Parameters
`path` | The absolute path of the item. |
Removed metadata for an object at an absolute URL.
Declaration
Swift
public class func remove(url: URL)
**Parameters**
<table>
<tr><td> `url` </td><td> The absolute URL of the item. </td></tr>
<table>
---
<br>
### remove(path:)
Removed metadata for an object at an absolute path.
**Declaration**
> <sub>**Swift**</sub>
> ```swift
public class func remove(path: String)
Parameters
`path` | The absolute path of the item. |