apple-watch

WatchOS2 WCSession How many delegates can the WCSession have in WatchKitExtension?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 17:35:42
My iOS app sends timely information via the WatchConnectivity framework. The receiving side implements the delegate of WCSession. I have 2 interfaceControllers that need the information sent from the WCSession. One is the glanceInterfaceController and the other is my mainInterfaceController. Can both of them be assigned the delegate and both receive the userInfo or applicationContext sent from my iOS app at the same time? or can there only be one WCSession delegate assigned and my controllers need to get the data from the object that is assigned? Thanks! WCSession only supports a single

WatchOS2 WCSession How many delegates can the WCSession have in WatchKitExtension?

人走茶凉 提交于 2019-12-01 17:04:00
问题 My iOS app sends timely information via the WatchConnectivity framework. The receiving side implements the delegate of WCSession. I have 2 interfaceControllers that need the information sent from the WCSession. One is the glanceInterfaceController and the other is my mainInterfaceController. Can both of them be assigned the delegate and both receive the userInfo or applicationContext sent from my iOS app at the same time? or can there only be one WCSession delegate assigned and my controllers

WatchKit Upload

久未见 提交于 2019-12-01 10:51:38
I am trying to submit my WatchKit app t iTunesConnect. I click "Archive" and then validate and I am shown the message below. I have created an App Id for the app, extension and WatchKit App as well as distribution profiles. Where am I going wrong? Thanks To properly sign a watch app, you need three different App IDs and each App ID needs a provision profile. Go to Developer Member Center Add/Edit the three App IDs: One for your main App bundle, you may need to add the entitlements you need, like App Groups , Keychain Access Group . One for your watchkit extension bundle, you may need to add

WatchKit Upload

僤鯓⒐⒋嵵緔 提交于 2019-12-01 07:34:24
问题 I am trying to submit my WatchKit app t iTunesConnect. I click "Archive" and then validate and I am shown the message below. I have created an App Id for the app, extension and WatchKit App as well as distribution profiles. Where am I going wrong? Thanks 回答1: To properly sign a watch app, you need three different App IDs and each App ID needs a provision profile. Go to Developer Member Center Add/Edit the three App IDs: One for your main App bundle, you may need to add the entitlements you

Get Unresolved Identifier for MMWormhole in Watch InterfaceController.swift

血红的双手。 提交于 2019-12-01 06:52:36
My Apple Watch project is in Swift. I have used CocoaPods to install MMWormhole, and I created the bridging header as described in these links: http://bencoding.com/2015/04/15/adding-a-swift-bridge-header-manually/ How to call Objective-C code from Swift When I created the bridging header, I target it to my iphone app, and also watch Extension. The bridging header.h, I have this: #import "MMWormhole.h" In my iPhone app View Controller, I have this: import UIKit import Foundation let wormhole = MMWormhole(applicationGroupIdentifier: "group.cocoShareData", optionalDirectory: "wormhole") and

Get Unresolved Identifier for MMWormhole in Watch InterfaceController.swift

青春壹個敷衍的年華 提交于 2019-12-01 05:15:15
问题 My Apple Watch project is in Swift. I have used CocoaPods to install MMWormhole, and I created the bridging header as described in these links: http://bencoding.com/2015/04/15/adding-a-swift-bridge-header-manually/ How to call Objective-C code from Swift When I created the bridging header, I target it to my iphone app, and also watch Extension. The bridging header.h, I have this: #import "MMWormhole.h" In my iPhone app View Controller, I have this: import UIKit import Foundation let wormhole

Getting server data for the Apple Watch

空扰寡人 提交于 2019-12-01 04:53:23
I am wondering how to go about designing a watchOS app that depends on getting the latest feed from a server. Would you need to use application context and just have the iPhone push it over in the background using the WatchConnectivity framework or would you use NSURLSession on the Apple Watch itself? Keep in mind this is for watchOS 2. You can use NSURLSession to handle your request. So your request would be native on your watchn. But note that your watch is there to show simple Content to the user. 来源: https://stackoverflow.com/questions/31465130/getting-server-data-for-the-apple-watch

How to stop Speech Recognition (Dictation) in Apple Watch when the user stops speaking?

十年热恋 提交于 2019-12-01 03:52:26
I have succesfully implemented native speech recognition (Dictation) in Apple Watch (WatchOS 2.1, iOS 9.2.1) basically I used this code, with an empty "menu options array": func launchDictation(){ self.presentTextInputControllerWithSuggestions([], allowedInputMode: WKTextInputMode.Plain, completion:{ (results) -> Void in let aResult = results?[0] as? String if(!(aResult == nil)){ print(aResult) print("SHORT ASR COMPLETED") dispatch_async(dispatch_get_main_queue()) { // Update UI } }//end if })//end show voice menu } As it is... the user taps a "Speak button", then a view pops up (showing the

Load image from URL on WatchKit

▼魔方 西西 提交于 2019-12-01 03:33:54
Is there a more elegant solution to load an external image on the watch than the following ? let image_url:String = "http://placehold.it/350x150" dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { let url:NSURL = NSURL(string:image_url)! var data:NSData = NSData(contentsOfURL: url)! var placeholder = UIImage(data: data)! // update ui dispatch_async(dispatch_get_main_queue()) { self.imageView.setImage(placeholder) } } NSURL is meant to be used for local files. Instead use NSURLSession. It's also useful to set the scale for the remote image. import WatchKit public

Not able to set custom fonts in WatchKit

三世轮回 提交于 2019-12-01 01:20:19
I am trying to set Roboto font and have added as target for watch kit extension, but it is still coming as nil. Can we set custom fonts in watch kit. Yes, you can use custom fonts in WatchKit https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/TextandLabels.html Yano Ratheez Its worked for me.. Using following Codes. Add the custom Font to both WatchKit Extension and WatchKit App target Info.plist Now you write the code following way, NSMutableAttributedString *attString =[[NSMutableAttributedString alloc] initWithString: @"Yano rocks!