WatchKit Is Here! Creating Apps for the Apple Watch
As promised, Apple has delivered its first version of WatchKit, which allows you to create apps for the upcoming Apple Watch. In a surprising move, Apple released information regarding its new WatchKit in a web page open to the general public.
New Information on the Apple Watch
In the information that Apple has made publicly available, here are some new things we have learned about Apple Watch:
The main part of a Watch App runs on the iPhone, not the Apple Watch! You deliver a Watch App within your iPhone App.
There are two parts of a Watch App are:
WatchKit Extension – This is the main app that actually runs on the iPhone.
User Interface – The app’s user interface is installed on the Apple Watch.
When a user launches your app on Apple Watch, the associated WatchKit extension is launched in the background on the iPhone.
The 38mm watch is 272×340 pixels and the 42mm watch is 312×390 pixels, which makes them Retina-quality.
Apple created a new San Francisco font specifically for legibility on the Apple Watch.
You can change the default font size on an Apple Watch.
When a notification is sent to Apple Watch, the wearer first receives a short-look notification containing a minimal amount of information. If the wearer keeps their wrist raised during a short-look notification, after a moment, it turns into a long-look notification, which contains more detailed information.
Even if you haven’t built a Watch App yet, wearers can still receive notifications on Apple Watch from your iOS apps.
Instead of referring to Watch App “users”, Apple refers to them as “wearers”. This is an important mind-set for developers to remember as they create Watch Apps.
It will be interesting to see how consumers respond to this iPhone / Apple Watch connection, and how well the link between the two devices works.
3 Ways to Interact With Apple Watch
There are three main ways your iOS app running on an iPhone can interact with Apple Watch:
WatchKit Apps – Your create a user interface that is installed on the Apple Watch that the wearer interacts with. The wearer can manually launch the app from the Home screen of their Apple Watch.
Actionable Notifications – Your app can send notifications the wearer can respond to by selecting an action, which can transition them to a specific area of your Watch App, or viewed later in Apple Watch Notification Center.
Glances – You can provide read-only alerts, which gives users an abbreviated view of important information in your app.
Architecture
The Watch app is comprised of these two main pieces, one that runs on the iPhone and another on the Apple Watch:
The WatchKit Extension runs on the iPhone. It executes code in response to user interactions on Apple Watch.
The Watch App’s user interface is located on the Apple Watch. It’s loaded from a bundle containing your storyboard, images and other resources.
When the wearer views your Watch App, Notification, or Glance, Apple Watch loads the appropriate interface. It communicates with the iPhone and tells it to run your WatchKit extension.
As the user interacts with the Watch App, Apple Watch and iPhone send information back and forth. User interaction on Apple Watch, causes code to be executed in your WatchKit extension on the iPhone. Your code on the iPhone updates the Watch App user interface and performs tasks related to providing data to the Watch App.
Watch Apps in Xcode
You need to get Xcode 6.2 beta from the iOS Dev Center in order to create Watch Apps.
To create a Watch App, you add a new Watch App target to your existing iOS app. Your iOS app installs and manages your Watch app. You use the same familiar Xcode tools such as storyboards and code editors to design a Watch App.
The iOS Simulator allows you to view and debug your Watch app. To view the Watch App in the Simulator, select one of the Apple Watch options in the Simulator’s Hardware menu. You can even test and debug custom notifications in the iOS Simulator.
WatchKit Framework
There are a variety of UI elements in WatchKit framework that you can incorporate in your Watch Apps. Here are some of the controls highlighted by Apple:
Dates and timers update their values dynamically. Once set, these objects run autonomously on the Apple Watch and do not need additional intervention from your WatchKit extension on the iPhone.
The Map control is a non-interactive version of the standard map interface. You create a map snapshot in your WatchKit extension on the iPhone and send it to the Apple Watch for display. When the user taps the map control, it takes them to the Maps App on the Apple Watch.
A wearer displays a menu in your app using a force touch gesture. A menu can contain one to four items and each menu item consists of an icon and a label (the label can contain two lines of text).
Where to Learn More
I’ve just touched the surface of all the information Apple has released about Apple Watch Apps. To find out more, check out this link, which includes a 27-minute video that provides an overview of the development process. I’m looking forward to diving in and will be writing more about WatchKit in this column!
watchkit อยู่ที่นี่ ! สร้างแอพสำหรับแอปเปิ้ลดู
ตามที่สัญญา , แอปเปิ้ลได้ส่งของรุ่นแรกของ watchkit ซึ่งช่วยให้คุณสามารถสร้างปพลิเคชันเพื่อดูแอปเปิ้ลที่จะเกิดขึ้น ในการย้ายน่าแปลกใจที่แอปเปิ้ลปล่อยข้อมูลเกี่ยวกับ watchkit ใหม่ในหน้าเว็บที่เปิดให้ประชาชนทั่วไป .
ข้อมูลใหม่บนแอปเปิ้ลดู
ในข้อมูลที่ Apple ได้ทำสาธารณะที่พร้อมใช้งานที่นี่มีบางสิ่งใหม่เราได้เรียนรู้เกี่ยวกับแอปเปิ้ลดู :
ส่วนหลักของนาฬิกา app รันบน iPhone , แอปเปิ้ลดู คุณช่วยดู app ใน app iPhone ของคุณ .
มีสองส่วนของนาฬิกา App :
watchkit นามสกุล–นี้เป็นหลัก แล้วรัน app บน iPhone .
ส่วนติดต่อผู้ใช้ของโปรแกรมประยุกต์และผู้ใช้มีการติดตั้งบน
ดูแอปเปิ้ลเมื่อผู้ใช้เปิดตัว app ของคุณในแอปเปิ้ลดู watchkit เกี่ยวข้องการเปิดตัวในพื้นหลังบน iPhone
นาฬิกา 38mm มี 272 × 340 พิกเซลและนาฬิกา 42mm 312 × 390 พิกเซลซึ่งให้คุณภาพของจอตา .
แอปเปิ้ลสร้างแบบอักษรซานฟรานซิสโกใหม่โดยเฉพาะสำหรับการทดสอบบนนาฬิกาแอปเปิ้ล
คุณสามารถเปลี่ยนขนาดตัวอักษรเริ่มต้นในการชม
Appleเมื่อการแจ้งเตือนจะถูกส่งไปยังแอปเปิ้ลดู ผู้สวมใส่แรกได้รับสั้นดูประกาศที่มีจำนวนน้อยที่สุดของข้อมูล หากผู้สวมใส่ทำให้ข้อมือของพวกเขาขึ้นมาในการแจ้งเตือนดูสั้นๆ หลังจากนั้นก็กลายเป็นการแจ้งเตือนมีลักษณะยาว ซึ่งมีรายละเอียดมากขึ้น .
ถ้าคุณยังไม่ได้สร้างดู app เลยผู้สวมใส่ยังสามารถได้รับการแจ้งเตือนเกี่ยวกับ Apple ดูจาก iOS ปพลิเคชันของคุณ .
แทนที่จะหมายถึงดู app " ผู้ใช้ " , แอปเปิ้ลหมายถึงพวกเขาเป็น " สวมใส่ " นี้เป็นสิ่งสำคัญสำหรับนักพัฒนาที่จะตัดสินใจว่าพวกเขาสร้างปพลิเคชันดู .
มันจะน่าสนใจเพื่อดูว่าผู้บริโภคตอบสนองต่อนี้ iPhone / Apple ดูการเชื่อมต่อและวิธีการที่ดีที่เชื่อมโยงระหว่างสองอุปกรณ์ทำงาน
3 วิธีที่จะโต้ตอบกับแอปเปิ้ลดู
มีสามวิธีหลักของคุณ iOS app รันบน iPhone สามารถโต้ตอบกับแอปเปิ้ลดู
watchkit ปพลิเคชันเพื่อสร้างส่วนติดต่อผู้ใช้ที่ติดตั้งบนแอปเปิ้ลดูว่าผู้สวมใส่มีปฏิสัมพันธ์ด้วย ผู้สวมใส่สามารถเปิด app จากหน้าจอหลักของนาฬิกาแอปเปิ้ลของพวกเขา .
การแจ้งเตือนเรา– app ของคุณสามารถส่งการแจ้งเตือนผู้สวมใส่สามารถตอบสนองโดยการเลือกการกระทำ ซึ่งสามารถเปลี่ยนพวกเขาไปยังพื้นที่ที่เฉพาะเจาะจงของ app ของคุณดู หรือดูในภายหลังในประกาศศูนย์แอปเปิ้ลดู
สายตา–คุณสามารถแจ้งเตือนให้อ่านได้อย่างเดียว ซึ่งจะช่วยให้ผู้ใช้มุมมองย่อของข้อมูลที่สำคัญใน app ของคุณ .
สถาปัตยกรรม
app ดูประกอบด้วยสองหลักชิ้นหนึ่งที่วิ่งบน iPhone และอีกด้านดูแอปเปิ้ล :
watchkit ขยายรันบน iPhone มันรันโค้ดในการตอบสนองต่อการติดต่อผู้ใช้แอปเปิ้ลดู
ส่วนติดต่อผู้ใช้ดู app ตั้งอยู่บนนาฬิกาแอปเปิ้ล มันโหลดจากกลุ่มที่มีเรื่องราวของคุณภาพและทรัพยากรอื่น ๆ .
เมื่อผู้สวมใส่มุมมอง app นาฬิกาแจ้งเตือนหรืออย่างรวดเร็ว , แอปเปิ้ลดูโหลดอินเตอร์เฟซที่เหมาะสม มันสื่อสารกับ iPhone และบอกมันวิ่งต่อ watchkit ของคุณ
เป็นผู้ใช้โต้ตอบกับ app iPhone แอปเปิ้ลดูนาฬิกา และส่งข้อมูลกลับมา ผู้ใช้แอปเปิ้ลดู สาเหตุของรหัสที่จะดำเนินการในการขยาย watchkit ของคุณบน iPhoneรหัสของคุณบน iPhone อัพเดตนาฬิกา App ส่วนติดต่อกับผู้ใช้ ดําเนินงานที่เกี่ยวข้องกับการให้ข้อมูลกับ app ดู
ดูปพลิเคชันใน Xcode
คุณต้องได้รับ Xcode 6.2 Beta จาก iOS Dev Center เพื่อที่จะสร้างปพลิเคชันดู
เพื่อสร้างดู app , คุณเพิ่ม app ใหม่ดูเป้าหมาย ของคุณที่มีอยู่ใน iOS App แอพ iOS ของคุณติดตั้งและจัดการ app นาฬิกาคุณสามารถใช้เดียวกันคุ้นเคย XCode เครื่องมือเช่นดาวน์โหลดและรหัสบรรณาธิการออกแบบนาฬิกา App .
iOS Simulator ช่วยให้คุณดูและแก้ปัญหา app นาฬิกา ไปดูใน app นาฬิกาจำลอง เลือกหนึ่งในตัวเลือกในเมนูฮาร์ดแวร์แอปเปิ้ลดูของจำลอง คุณสามารถทดสอบและแก้ปัญหาการแจ้งเตือนที่กำหนดเองใน iOS Simulator .
watchkit กรอบมีความหลากหลายขององค์ประกอบ UI ใน watchkit กรอบที่คุณสามารถรวมในปพลิเคชัน นาฬิกา นี่คือบางส่วนของการควบคุมเน้นโดยแอปเปิ้ล :
วันที่และจับเวลาปรับปรุงค่าแบบไดนามิก เมื่อตั้งค่า วัตถุเหล่านี้ทำงานอัตโนมัติในนาฬิกาแอปเปิ้ลและไม่ต้องการการแทรกแซงเพิ่มเติมจากการ watchkit ของคุณบน iPhone .
การควบคุมแผนที่เป็นรุ่นของอินเตอร์เฟซแบบโต้ตอบบนแผนที่มาตรฐาน คุณสร้างแผนที่ภาพรวมในการส่งเสริม watchkit ของคุณบน iPhone และส่งให้ดูแอปเปิ้ลจอแสดงผล เมื่อผู้ใช้ก๊อกการควบคุมแผนที่มันพาไปหน้า app บนนาฬิกาแอปเปิ้ล
สวมใส่แสดงเมนูใน app ของคุณโดยใช้แรงสัมผัสท่าทางเมนูสามารถมีหนึ่งถึงสี่รายการ และแต่ละรายการประกอบด้วยเมนูไอคอนและป้าย ( ป้ายสามารถประกอบด้วยสองบรรทัดของข้อความ ) .
ที่ต้องเรียนรู้เพิ่มเติม
ผมเพิ่งสัมผัสพื้นผิวของข้อมูลทั้งหมดที่แอปเปิ้ลได้เปิดตัวเกี่ยวกับแอปเปิ้ลดูปพลิเคชัน เพื่อหาข้อมูลเพิ่มเติม , ตรวจสอบการเชื่อมโยงนี้ ซึ่งรวมถึงวิดีโอ 27 นาทีที่ให้ภาพรวมของกระบวนการพัฒนาฉันรอคอยที่จะดำน้ำในและจะเขียนเพิ่มเติมเกี่ยวกับ watchkit ในคอลัมน์นี้
การแปล กรุณารอสักครู่..
