This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
| } | |
| override func didReceiveMemoryWarning() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // TestSwift | |
| // | |
| // Created by Jameson Quave on 6/2/14. | |
| // Copyright (c) 2014 JQ Software LLC. All rights reserved. | |
| // | |
| import UIKit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class AnotherClass { | |
| var someVar = 1 | |
| let someConst = 2 | |
| func somePrivateFunc() -> Bool { | |
| return true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| if cell == nil { | |
| cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
| } | |
| var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
| // Add a check to make sure this exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| if cell == nil { | |
| cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
| } | |
| var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
| // Add a check to make sure this exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| if cell == nil { | |
| cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
| } | |
| var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
| // Add a check to make sure this exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| if cell == nil { | |
| cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
| } | |
| var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
| // Add a check to make sure this exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| if cell == nil { | |
| cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
| } | |
| var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
| // Add a check to make sure this exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
| var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
| // Find this cell's album by passing in the indexPath.row to the subscript method for an array of type Album[] | |
| let album = self.albums[indexPath.row] | |
| cell.text = album.title | |
| cell.image = UIImage(named: "Blank52") | |
| cell.detailTextLabel.text = album.price | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In your APIController: | |
| Modify the protocol to understand arrays: | |
| protocol APIControllerProtocol { | |
| func didRecieveAPIResults(results: NSDictionary) | |
| func didRecieveAPIResults(results: NSArray) | |
| } | |
| Add a get function to perform arbitrary gets on URLs |