Skip to content

Instantly share code, notes, and snippets.

@aclissold
Created December 17, 2014 00:46
Show Gist options
  • Save aclissold/82113940de312e862b87 to your computer and use it in GitHub Desktop.
Save aclissold/82113940de312e862b87 to your computer and use it in GitHub Desktop.
diff --git a/The Oakland Post/PostTableViewController.swift b/The Oakland Post/PostTableViewController.swift
index a2666ed..7f5c336 100644
--- a/The Oakland Post/PostTableViewController.swift
+++ b/The Oakland Post/PostTableViewController.swift
@@ -17,7 +17,7 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate,
}
var baseURL: String!
- var feedParser: FeedParser!
+ var feedParser: MWFeedParser!
var parsedItems = [MWFeedItem]()
var finishedParsing = false
@@ -29,8 +29,9 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate,
refreshControl.addTarget(self, action: "refresh", forControlEvents: UIControlEvents.ValueChanged)
self.refreshControl = refreshControl
- feedParser = FeedParser(baseURL: baseURL, length: 15, delegate: self)
- feedParser.parseInitial()
+ feedParser = MWFeedParser(feedURL: NSURL(string: "http://www.oaklandpostonline.com/search/?t=article&q=test&f=rss"))
+ feedParser.delegate = self
+ feedParser.parse()
tableView.addInfiniteScrollingWithActionHandler(loadMorePosts)
}
@@ -53,7 +54,7 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate,
UIApplication.sharedApplication().networkActivityIndicatorVisible = true
tableView.userInteractionEnabled = false
parsedItems.removeAll()
- feedParser.parseInitial()
+ feedParser.parse()
}
override func preferredStatusBarStyle() -> UIStatusBarStyle {
@@ -63,7 +64,7 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate,
func loadMorePosts() {
UIApplication.sharedApplication().networkActivityIndicatorVisible = true
tableView.userInteractionEnabled = false
- feedParser.parseMore()
+ feedParser.parse()
}
// MARK: StarButtonDelegate
@@ -103,7 +104,7 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate,
UIApplication.sharedApplication().networkActivityIndicatorVisible = false
SVProgressHUD.dismiss()
refreshControl!.endRefreshing()
- tableView.infiniteScrollingView.stopAnimating()
+ tableView.infiniteScrollingView?.stopAnimating()
tableView.userInteractionEnabled = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment