Class
UpdateFeedManager
public class UpdateFeedManager
The UpdateFeedManager class contains functions to create and edit update feeds.
Initializers
init(feedUrl:)
public init(feedUrl: URL)
Initialize the UpdateFeedManager class.
Parameters
| Name | Type | Description |
|---|---|---|
| feedUrl | URL |
The URL to the JSON update feed, used when loading an already existing feed. |
Methods
load()
public func load()
Load an existing feed from the URL the class was initialized with.
create(website:)
public func create(website: URL)
Create a new feed
Parameters
| Name | Type | Description |
|---|---|---|
| website | URL |
The main website URL |
clearItems()
public func clearItems()
Clear all itmes in the feed.
add(item:)
public func add(item: Item)
Add an item to the update feed.
Parameters
| Name | Type | Description |
|---|---|---|
| item | Item |
The item to be added |
write(to:)
public func write(to location: URL)
Write the feed to disk
Parameters
| Name | Type | Description |
|---|---|---|
| location | URL |
The local URL where the feed is written to |
logFeed()
public func logFeed()
Log the feed and its content to the console