watchkit

Refresh NSManagedObjectContext

只谈情不闲聊 提交于 2019-11-30 18:25:12
问题 I am writing a WatchKit extension for an iPhone application. I share Core Data using App Groups. This is working, the data is shared. When a new NSManagedObject is created using watch I send a notification to the iPhone app that a new object was created. To do that I use MMWormhole . The iPhone app receives the MMWormhole notification and now I have to do the last step - refresh NSManagedObjectContext . How can I do it? I was trying to forward notification of

WatchOS 2: “Cannot Install Watch App” “Error Launching 'TestApp WatchKit App Extension'”

佐手、 提交于 2019-11-30 17:29:58
I am getting a AlertView popup error on iOS every time I try to install a watchOS 2 app in Xcode 7 beta 4: Cannot Install Watch App TestApp is installed on your iPhone, but the TestApp app for Apple Watch is currently unavailable. I've also tried installing the watchOS app through the Apple Watch iOS app, but I get the same error. And when I try to run the watchOS target, I get this: Error Launching 'TestApp WatchKit App Extension' Installation error. Check the iPhone console for more details." I checked the iPhone console and no additional details are there. I've reinstalled Xcode, deleted

Using Core Location in Apple WatchKit

夙愿已清 提交于 2019-11-30 17:28:01
问题 I'm currently developing an apple watch extension. Anybody knows if the current location is provided by iPhone or Watch itself? I can't find any information about this and i need to draw a compass pointing where the watch is pointing. 回答1: In order to do what you want you don't need CoreLocation you just need a magnetometer. AFAIK the Apple Watch doesn't have one built in. The sensors it has are... Accelerometer Gyroscope Heart rate sensor Barometer No magnetometer though. 回答2: According to

How can I change the label “Cancel” from modal segue in Apple Watch

走远了吗. 提交于 2019-11-30 17:20:46
How to change the label appearing at the top left corner that says "Cancel" when I open a modal view... I would like it to be a button with an image. The label Cancel is the default 'title' of a modally presented WKInterfaceController, which appears on the Apple Watch status bar. Replacing the title with an image It is not possible to hide the status bar, nor is it possible to display an image in the status bar, neither as part of this link nor to replace this link. Options to set modal view title You can however set the title to a new string value. For instance, you might well want to replace

How To Share Data with Watch OS 2 to display in WKInterfaceTable when working with CoreData

核能气质少年 提交于 2019-11-30 16:24:40
I am using WatchConnectivity to try to send data of type NSManagedObject called arrayOfOjects to the Watch. Each object has a string property called title . The InterfaceController on the Watch loads and displays and empty table - as intended because the array is empty, then when the user requests the data it is sent using the didReceiveMessage method on the phone. I am unsure how to add the dictionary array to the objectsArray to display in the WKInterfaceTable . Does anyone know how I can send the data to the watch to display in the table to make changes and sync them back with the phone ?

WatchKit App Rejected for “Failing to Install”

落爺英雄遲暮 提交于 2019-11-30 12:53:50
I built an iOS app with a companion Apple Watch app and recently submitted it to the App Store. This morning, it was rejected for failing to install. Here are the steps to reproduce: Install the app on iPhone Launch the companion app Toggle the "Show App on Apple Watch" switch The app attempts to install on the Apple Watch Error message is displayed on Apple Watch and app in not installed. Toggle switch in the companion app is set to "off" Obviously, I don't have an Apple Watch to test this with, but it works fine in the simulator (and installs fine on the Apple Watch simulator). Perhaps it

Can I upload my application utilizing WatchKit to the App Store now?

≡放荡痞女 提交于 2019-11-30 10:36:44
I made an application includes an iOS App and a WatchKit App; each part can run standalone. Can I upload this application to App Store now, so that it will be ready for Apple Watch when it's released, or do I have to wait? If the answer is yes, do I have to upload it to iTunes Connect through Xcode or Xcode Beta? As of Tuesday, March 31, 2015, all registered Apple developers can submit new apps and updates containing WatchKit extensions to the App Store . If you need help, Apple has published instructions on its WatchKit site to help you prepare the required materials. Good luck to all!

WKURLSessionRefreshBackgroundTask isn't called when attempting to do background refreshes in watchOS

旧巷老猫 提交于 2019-11-30 09:36:55
I'm working on a complication to get scheduled data from a web service. Every 20-30 minutes (or manually), I am scheduling a WKRefreshBackgroundTask to do this. As suggested by Apple, I want the OS to handle the fetching of this data via a background NSURLSession . This is the function I use to download the data I need: func scheduleURLSession() { print("\nScheduling URL Session...") let backgroundSessionConfig:URLSessionConfiguration = URLSessionConfiguration.background(withIdentifier: NSUUID().uuidString) backgroundSessionConfig.sessionSendsLaunchEvents = true let backgroundSession =

WatchKit Complication: get Complication data from extension delegate

隐身守侯 提交于 2019-11-30 07:34:35
I have all the data I need in my WatchKit Extension (passed from the iOS app). I used the data in the WatchKit InterfaceController to fill in a table, which works perfectly. I'm trying to figure out the best way to get that same data in my WatchKit ComplicationController . Currently, in the InterfaceController , the data gets passed in using didReceiveUserInfo : func session(session: WCSession, didReceiveUserInfo userInfo: [String : AnyObject]) { if let beachValue = userInfo["Surf"] as? String { places.append(Place(dataDictionary: ["Surf" : surfValue])) } else { print("Something went wrong") }

How can I open the parent app on iPhone from my WatchKit app?

梦想与她 提交于 2019-11-30 07:25:13
I'm trying to open the parent application of my Apple Watch app. In Xcode Beta 2 we could use this code: WKInterFaceController.openParentApplication However, in Xcode beta 3 I couldn't found that code any longer. Now I don't know how to open the parent application from the watch app. Please help. The Objective-C method is: + (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *replyInfo, NSError *error))reply The Swift method is: class func openParentApplication(_ userInfo: [NSObject : AnyObject]!, reply reply: (([NSObject : AnyObject]!, NSError!) -> Void)!) ->