Skip to content

Commit

Permalink
Fixing some optional init issues that prevented compilation; should w…
Browse files Browse the repository at this point in the history
…ork on Xcode 6.1 now
  • Loading branch information
austinzheng committed Nov 10, 2014
1 parent cbab687 commit f179f06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion swift-2048/AppearanceProvider.swift
Expand Up @@ -50,6 +50,9 @@ class AppearanceProvider: AppearanceProviderProtocol {

// Provide the font to be used on the number tiles
func fontForNumbers() -> UIFont {
return UIFont(name: "HelveticaNeue-Bold", size: 20)
if let font = UIFont(name: "HelveticaNeue-Bold", size: 20) {
return font
}
return UIFont.systemFontOfSize(20)
}
}
2 changes: 1 addition & 1 deletion swift-2048/NumberTileGame.swift
Expand Up @@ -116,7 +116,7 @@ class NumberTileGameViewController : UIViewController, GameModelProtocol {
// Create the score view
let scoreView = ScoreView(backgroundColor: UIColor.blackColor(),
textColor: UIColor.whiteColor(),
font: UIFont(name: "HelveticaNeue-Bold", size: 16.0),
font: UIFont(name: "HelveticaNeue-Bold", size: 16.0) ?? UIFont.systemFontOfSize(16.0),
radius: 6)
scoreView.score = 0

Expand Down

0 comments on commit f179f06

Please sign in to comment.