Skip to content
James Barrow edited this page Jan 29, 2017 · 4 revisions

ContentManager

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.

contentMetadata

Declaration

Swift

private lazy var contentMetadata = String: Date

---

<br>

### maxSavedTimeInSeconds


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
private static var maxSavedTimeInSeconds: TimeInterval


## Singleton

shared

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()


save(url:)

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.


remove(url:)

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.

Clone this wiki locally