watch-os-2

Proper way to debug watchos2 app in XCode7

醉酒当歌 提交于 2019-12-10 13:39:52
问题 I'm rewriting my watch app to work in watchos2 but have problems debugging on the actual watch (XCode7). What is the correct way how to do this? 1) Obvious (but naive) approach - connect your phone with paired watch, in XCode select Extension scheme to run on Phone + Watch. Click play and it should work, right? This seems to work only just after fresh pairing and breaks very quickly (after few debug runs). See issues and behaviour below 2) Run phone app first then add run of extension - this

Watch OS 2 Issue to set an Image

橙三吉。 提交于 2019-12-10 13:27:37
问题 I just want to add an image to my WKInterfaceController but... Xcode tells me : Unable to find image named "circle44" on Watch @IBOutlet var cirlceImage: WKInterfaceImage! override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) cirlceImage.setImageNamed("circle44") } 回答1: Okay I found the result the image have to be in your WatchKt App not on your Extension. And with the addition of app thinning the watch no longer searches for 1x images as they should all be 2x.

Selector not called on selecting menu item after force touch

六眼飞鱼酱① 提交于 2019-12-10 13:04:43
问题 I have this code, for responding to a menu item being tapped after a force touch: class InterfaceController: WKInterfaceController { override init() { super.init() self.addMenuItemWithItemIcon(WKMenuItemIcon.Pause, title: "Pause", action: Selector("test")) } func test() { print("test") } } When I force touch, the menu appears. When I tap the "Pause" button, test() is not called. Any ideas why this might be? 回答1: Solved. Though its the result of a silly mistake (aren't most problems?), I think

Passing Data From A Class To WatchOS 2 (Connectivity)

Deadly 提交于 2019-12-10 11:40:08
问题 I'm hoping someone here may have some thoughts on Watch OS 2 connectivity that can point me in the right direction. Succinctly, I am trying to pass a set of data (from a custom class called FileData) to my WatchKit extension. When I run the WatchKit app, I can see that the WCSession is being activated, but the dataset never seems to get passed to the Watch (though if I change the data to a String and pass something simple like "hello", it does work properly); TableViewController.swift (iOS

watchOS2 - CMSensorRecorder

血红的双手。 提交于 2019-12-10 10:08:27
问题 I want to use the historical accelerometer data from the Apple Watch and my accDataList is always nil. I instantiated CMSensorRecorder in the init function of the class. Does someone had this problem before? func startMovementDetection(){ self.cmSensorRecorder?.recordAccelerometerFor(self.recorderDuration) self.startDate = NSDate() } func extractHistoricalAccelerometerData(){ var accDataList = self.cmSensorRecorder!.accelerometerDataFrom(self.startDate, to: NSDate()) NSLog("AccDataList : \

watchOS 2 working with CocoaPods

天大地大妈咪最大 提交于 2019-12-10 09:46:29
问题 Has anyone gotten CocoaPods working with watchOS 2? I tried using ‘use_framework!’ with ‘platform :watchos, ‘2.0’ but it says "[!] Invalid Podfile file: Unsupported platform watchos2 . Platform must be :ios or :osx .. Updating CocoaPods might fix the issue.” I am on the latest version of CocoaPods. 回答1: CocoaPods currently doesn't support watchos. There is a work in progress issue here for adding support for it. 回答2: CocoaPods released new version which is 0.38.0 and now supports watchOS 2.

watchOS Error: Unknown property in Interface description for controller

拜拜、爱过 提交于 2019-12-10 03:32:16
问题 I added a WKInterfacePicker to the storyboard and connected it to an IBOutlet in the interface controller. While running the application, it shows an error message in the console: Unknown property in Interface description ('watchPicker') for controller Code: @interface InterfaceController() { __unsafe_unretained IBOutlet WKInterfacePicker *watchPicker; } @end How can I fix it? 回答1: Create IBOutlet as property for WKInterfacePicker , you will not get message. @property (unsafe_unretained,

WCSession - PayloadTooLarge

爱⌒轻易说出口 提交于 2019-12-09 07:34:25
Apple Documentation shows: PayloadTooLarge - An error indicating that the item being sent exceeds the maximum size limit. This type of error can occur for both data dictionaries and files. Available in watchOS 2.0 and later. Does anyone know what the max size limits are for both these methods are for transferring data from the watch to the phone?: func transferUserInfo(_ userInfo: [String : AnyObject]) -> WCSessionUserInfoTransfer and func transferFile(_ file: NSURL, metadata metadata: [String : AnyObject]?) -> WCSessionFileTransfer I can't find it documented anywhere. Thanks! BootMaker

Is it safe to use updateApplicationContext to send keychain value

左心房为你撑大大i 提交于 2019-12-08 15:05:13
问题 In watchOS 2, there are no more shared keychains. If I want to send a keychain value from the iOS app to the Watch app, is it safe to send it via WCSession updateApplicationContext? 回答1: As per the Apple Security guideline:- Keychain Data Protection Many apps need to handle passwords and other short but sensitive bits of data, such as keys and login tokens. The iOS keychain provides a secure way to store these items. The keychain is implemented as a SQLite database stored on the file system.

secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found

有些话、适合烂在心里 提交于 2019-12-08 14:42:22
问题 In two applications which have WatchKit app extensions, I receive the following error in the device log more than ten times on startup. secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found Folks over at the Apple Developer forums have also reported this. Thread here... https://forums.developer.apple.com/thread/20193 But, no one has found any solution. Anyone have any ideas? The app does start and run fine, but I'm concerned that these messages / errors might be