Permalink
Browse files

Updated to Swift 2.

  • Loading branch information...
erikdoe committed Oct 3, 2015
1 parent 94a9167 commit a46478f8dd0aee60517868f3964f95103a2a3f18
@@ -187,6 +187,8 @@
03151B221948E756009A27B8 /* Project object */ = {
isa = PBXProject;
attributes = {
+ LastSwiftMigration = 0700;
+ LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0600;
ORGANIZATIONNAME = "Mulle Kybernetik";
TargetAttributes = {
@@ -8,16 +8,15 @@
import Foundation
-@objc
-class Controller {
+class Controller: NSObject {
var connection: Connection;
var data: String;
class func newController() -> Controller {
return Controller()
}
- init() {
+ override init() {
self.connection = ServerConnection();
self.data = "";
}
@@ -41,9 +41,9 @@ class MasterViewController: UITableViewController {
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" {
- if let indexPath = self.tableView.indexPathForSelectedRow() {
- let object = objects[indexPath.row] as NSDate
- (segue.destinationViewController as DetailViewController).detailItem = object
+ if let indexPath = self.tableView.indexPathForSelectedRow {
+ let object = objects[indexPath.row] as! NSDate
+ (segue.destinationViewController as! DetailViewController).detailItem = object
}
}
}
@@ -61,7 +61,7 @@ class MasterViewController: UITableViewController {
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
- let object = objects[indexPath.row] as NSDate
+ let object = objects[indexPath.row] as! NSDate
cell.textLabel!.text = object.description
return cell
}

0 comments on commit a46478f

Please sign in to comment.