Apple Watch Development (ii)--xcode create a project and its structure

Source: Internet
Author: User


in the previous article that described Apple Watch's features and app run mode, let's look at how to create an Apple Watch project with Xcode.

First, the operating environment

first of all we have to use this Xcode to create the Watch app must pay attention to the development environment, WatchKit is added in the Xcode6.2beta version, so we need:

1, computer system in Mac OS10.9.4 above;

2, Xcode in the 6.2beta version above, of course, now Xcode has reached 6.3.1, with the latest version can be;

Ii. Creation of the project

with a development environment, I started using Xcode to create a project that supports Apple Watch.

1, we first create a single view of the iOS project;


2, fill in the name of the project, the rest of their own casually write, equipment here to choose "iphone", because now Apple Watch also only support iphone device, programming language I choose the more familiar objective-c language, choose "Next", select Save Location " Create ";


3. Now that I've created a normal single view project, just like the one we used before, how do I get it to support Apple Watch?


4. To add the target for Apple Watch, here are two ways to File-new-target from the Xcode menu, or select "Add Target ..." directly from the project settings and select Apple Watch in the box to continue:

Or

Then we choose



5, in the new box we found that the project name and identifier are not editable, which also confirms that we said the Apple Watch app and iphone app binding, linkage, the following two tick options are optional, That is, we said in the last two kinds of interactive mode or interface type, here we can all choose to look at the effect, "Finish":


6, at this time there will be a box, directly click OK to activate it, here is the change scheme mode, will also introduce how to change the scheme;


7, add finished, we found that the left side of the file section than before two more folders, a watchdemo watchkit extension that we said in the last part of the code running on the iphone, Watchdemo WatchKit The app is the UI part of what we said in the last page that runs on the Watch side, and we'll find that the UI section automatically generates the Interface.storyboard,watch app-side UI that can now be laid out in this storyboard way:


8, now estimated to be eager to run a look at the effect of it, but you now run to see the Apple Watch Simulator, what is the matter? At this point we're going to show the simulator for Apple Watch, first check the iphone emulator and then go to the menu settings:


9, show watch Simulator, re-run the project, awaited began to come out, watch finally appeared, but only a status bar, has not added any components; it's easy to create an Apple Watch project. Go ahead and explore!


10, just add target when said scheme can be edited, then it is very simple, in the running target of the option to click on the edit scheme to enter the design interface:


11, the Watch interface here is the choice of priority loading interface, that is, automatically created several storyboard; After the modification, you will see the priority loading interface;

12, just for the Xcode6.2beta version, if you are the latest Xcode6.3 and above, you can directly select the running target to modify the priority loading interface:




So here's a simple Apple Watch development project, so what's the use of this file? WatchKit What is the god horse thing? Keep talking in the next article.

(Reproduced Please specify: http://blog.csdn.net/yujianxiang666)

Apple Watch Development (ii)--xcode create a project and its structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.