Skip to content

Instantly share code, notes, and snippets.

@thinkclay
Last active August 29, 2015 14:03
Show Gist options
  • Save thinkclay/170911fae42e0c0b296a to your computer and use it in GitHub Desktop.
Save thinkclay/170911fae42e0c0b296a to your computer and use it in GitHub Desktop.
import UIKit
import SwifteriOS
class TweetsViewController: UITableViewController {
var tweets : [JSONValue] = []
override func viewWillLayoutSubviews()
{
super.viewWillLayoutSubviews()
self.tableView.contentInset = UIEdgeInsetsMake(self.topLayoutGuide.length, 0, 0, 0)
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(self.topLayoutGuide.length, 0, 0, 0)
}
override func didReceiveMemoryWarning()
{
super.didReceiveMemoryWarning()
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tweets.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: .Subtitle, reuseIdentifier: nil)
cell.textLabel.text = tweets[indexPath.row]["text"].string
return cell
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment