Skip to content

Commit

Permalink
Fix compliation errors for swift 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
softdevstory committed Apr 12, 2015
1 parent 2444ddd commit 74eac24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion FlappyBird/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
2 changes: 1 addition & 1 deletion FlappyBird/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate{
moving.speed = 1
}

override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
/* Called when a touch begins */
if moving.speed > 0 {
for touch: AnyObject in touches {
Expand Down
6 changes: 3 additions & 3 deletions FlappyBird/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import SpriteKit
extension SKNode {
class func unarchiveFromFile(file : NSString) -> SKNode? {

let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")
let path = NSBundle.mainBundle().pathForResource(file as String, ofType: "sks")

let sceneData = NSData(contentsOfFile: path!, options: .DataReadingMappedIfSafe, error: nil)
let archiver = NSKeyedUnarchiver(forReadingWithData: sceneData!)

archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as! GameScene
archiver.finishDecoding()
return scene
}
Expand All @@ -31,7 +31,7 @@ class GameViewController: UIViewController {

if let scene = GameScene.unarchiveFromFile("GameScene") as? GameScene {
// Configure the view.
let skView = self.view as SKView
let skView = self.view as! SKView
skView.showsFPS = true
skView.showsNodeCount = true

Expand Down

0 comments on commit 74eac24

Please sign in to comment.