Time for action—putting the HTML5 games into a Mac app
Follow the steps in Mac Xcode. We need a Mac and the Apple Xcode to create a Mac OS X app. Download Xcode from the Mac App Store if you haven't got it.
Note
Even if you don't have a Mac, you can still have a look at how we wrap the Web View with an application. The concept is more important than the steps in this section.
- Launch Xcode and create a new project. Select Cocoa Application under OS X:
- In the Options View, give the name of the game as Product Name. Organization Name can be your name or a company's name. Use a reversed domain as Organization Identifier. Choose Objective-C for this code example. We keep the default value for the other options.
- Open the
Main.storyboard
file from the left panel. In the bottom-right panel, choose the third tab (which is highlighted in blue in the following screenshot). Drag the Web View component into the Window View. The Web View should become full width and height when you drag...