Skip to content

Commit

Permalink
Updated to Swift 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdoe committed Oct 3, 2015
1 parent 94a9167 commit a46478f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
03151B221948E756009A27B8 /* Project object */ = { 03151B221948E756009A27B8 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0600; LastUpgradeCheck = 0600;
ORGANIZATIONNAME = "Mulle Kybernetik"; ORGANIZATIONNAME = "Mulle Kybernetik";
TargetAttributes = { TargetAttributes = {
Expand Down
5 changes: 2 additions & 3 deletions Examples/SwiftExamples/SwiftExamples/Controller.swift
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@


import Foundation import Foundation


@objc class Controller: NSObject {
class Controller {
var connection: Connection; var connection: Connection;
var data: String; var data: String;


class func newController() -> Controller { class func newController() -> Controller {
return Controller() return Controller()
} }


init() { override init() {
self.connection = ServerConnection(); self.connection = ServerConnection();
self.data = ""; self.data = "";
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class MasterViewController: UITableViewController {


override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" { if segue.identifier == "showDetail" {
if let indexPath = self.tableView.indexPathForSelectedRow() { if let indexPath = self.tableView.indexPathForSelectedRow {
let object = objects[indexPath.row] as NSDate let object = objects[indexPath.row] as! NSDate
(segue.destinationViewController as DetailViewController).detailItem = object (segue.destinationViewController as! DetailViewController).detailItem = object
} }
} }
} }
Expand All @@ -61,7 +61,7 @@ class MasterViewController: UITableViewController {
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as 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 cell.textLabel!.text = object.description
return cell return cell
} }
Expand Down

0 comments on commit a46478f

Please sign in to comment.