Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions swift-2048.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "f3nghuang.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -430,7 +430,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "f3nghuang.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion swift-2048/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

Expand Down
8 changes: 4 additions & 4 deletions swift-2048/NumberTileGame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ class NumberTileGameViewController : UIViewController, GameModelProtocol {
func setupSwipeControls() {
let upSwipe = UISwipeGestureRecognizer(target: self, action: #selector(NumberTileGameViewController.upCommand(_:)))
upSwipe.numberOfTouchesRequired = 1
upSwipe.direction = UISwipeGestureRecognizerDirection.up
upSwipe.direction = UISwipeGestureRecognizer.Direction.up
view.addGestureRecognizer(upSwipe)

let downSwipe = UISwipeGestureRecognizer(target: self, action: #selector(NumberTileGameViewController.downCommand(_:)))
downSwipe.numberOfTouchesRequired = 1
downSwipe.direction = UISwipeGestureRecognizerDirection.down
downSwipe.direction = UISwipeGestureRecognizer.Direction.down
view.addGestureRecognizer(downSwipe)

let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(NumberTileGameViewController.leftCommand(_:)))
leftSwipe.numberOfTouchesRequired = 1
leftSwipe.direction = UISwipeGestureRecognizerDirection.left
leftSwipe.direction = UISwipeGestureRecognizer.Direction.left
view.addGestureRecognizer(leftSwipe)

let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(NumberTileGameViewController.rightCommand(_:)))
rightSwipe.numberOfTouchesRequired = 1
rightSwipe.direction = UISwipeGestureRecognizerDirection.right
rightSwipe.direction = UISwipeGestureRecognizer.Direction.right
view.addGestureRecognizer(rightSwipe)
}

Expand Down
8 changes: 4 additions & 4 deletions swift-2048/Views/GameboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class GameboardView : UIView {
tile.layer.setAffineTransform(CGAffineTransform(scaleX: tilePopStartScale, y: tilePopStartScale))

addSubview(tile)
bringSubview(toFront: tile)
bringSubviewToFront(tile)
tiles[IndexPath(row: row, section: col)] = tile

// Add to board
UIView.animate(withDuration: tileExpandTime, delay: tilePopDelay, options: UIViewAnimationOptions(),
UIView.animate(withDuration: tileExpandTime, delay: tilePopDelay, options: UIView.AnimationOptions(),
animations: {
// Make the tile 'pop'
tile.layer.setAffineTransform(CGAffineTransform(scaleX: self.tilePopMaxScale, y: self.tilePopMaxScale))
Expand Down Expand Up @@ -134,7 +134,7 @@ class GameboardView : UIView {
let shouldPop = endTile != nil
UIView.animate(withDuration: perSquareSlideDuration,
delay: 0.0,
options: UIViewAnimationOptions.beginFromCurrentState,
options: UIView.AnimationOptions.beginFromCurrentState,
animations: {
// Slide tile
tile.frame = finalFrame
Expand Down Expand Up @@ -192,7 +192,7 @@ class GameboardView : UIView {

UIView.animate(withDuration: perSquareSlideDuration,
delay: 0.0,
options: UIViewAnimationOptions.beginFromCurrentState,
options: UIView.AnimationOptions.beginFromCurrentState,
animations: {
// Slide tiles
tileA.frame = finalFrame
Expand Down