watchOS 3 talk about various ways to build a compelling watch app for Apple Watch. Includes how-tos on accessibility, quick actions, watch connectivity, animation and watch complications.
15. @kristinathai
let suggestions = [“Hello world!”, “I’m on my way"]
presentTextInputControllerWithSuggestions(suggestions, allowedInputMode: .AllowEmoji)
{ (input) -> Void in
if let userInput = input?.first {
// Do something with user input here
self.contentLabel.setText(userInput as? String)
}
}
33. @kristinathai
WATCH CONNECTIVITY
COMMUNICATION CATEGORIES
Background transfers Interactive messaging
Information isn’t needed
immediately
Information needed
immediately
Operating system determines
the most suitable time to send
the data
Requires reachable state
Content is queued for transfer
34. @kristinathai
WATCH CONNECTIVITY
SENDER AND RECEIVERS - BACKGROUND TRANSFERS
Data Type Sender Receiver
Dictionary
(overwrite latest data)
updateApplicationContext didReceiveApplicationContext
Dictionary
(keep all data - FIFO)
transferUserInfo didReceiveUserInfo
File,
Dictionary (metadata)
transferFile didReceiveFile
35. @kristinathai
WATCH CONNECTIVITY
SENDER AND RECEIVERS - INTERACTIVE MESSAGING
Data Type Sender Receiver
Dictionary sendMessage didReceiveMessage
NSData sendMessageData didReceiveMessageData
36. @kristinathai
WATCH CONNECTIVITY
2 NEW WATCH CONNECTIVITY PROPERTIES
‣ hasContentPending
‣ Checks if session data has been received in background that needs to be
delivered
‣ remainingComplicationUserInfoTransfers
‣ Gives you remaining number of times you can send complication data from
iOS app to WatchKit extension
NEW
45. @kristinathai
CLOCKKIT - TEXT PROVIDERS
CLKSimpleTextProvider
let textProvider =
CLKSimpleTextProvider(text: "your string here", shortText: "string")
46. @kristinathai
CLOCKKIT - TEXT PROVIDERS
CLKDateTextProvider
Thursday, January 14, 2016
Thursday, January 14
Thursday, Jan 14
Thurs, Jan 14
Jan 14
14
let textProvider = CLKDateTextProvider(date: NSDate(), units: .Day)
54. @kristinathai
15% OF THE WORLD’S POPULATION
LIVES WITH SOME FORM OF DISABILITY
World Health Organization
WORLD REPORT ON DISABILITY
http://www.who.int/disabilities/world_report/2011/report/en/
59. @kristinathai
enum WKHapticType : Int {
case Notification
case DirectionUp
case DirectionDown
case Success
case Failure
case Retry
case Start
case Stop
case Click
}