watchkit

Creating progress circle as WKInterfaceImage in Watch App

时光毁灭记忆、已成空白 提交于 2019-11-28 20:45:49
I am trying to create a progress circle for the Apple Watch version of my app. I know that we aren't able to use UIViews (which would make things so much easier!) so I am looking for alternatives. Basically, I would like to create one of these prototypes: The way I was hoping to do things was to add the background layers as a normal WKInterfaceImage and then the progress arrow/line on top as a WKInterfaceImage that rotates around the circle based on the percentage calculated. I have the percentage calculated so basically, what I am looking for is some help with the math code for rotating the

How to launch iOS App from Apple Watch?

可紊 提交于 2019-11-28 19:39:49
Is there any way to launch the iOS App from Apple Watch? Edit :- Tried using both api below but doesn't work:- Apple Watch Code Calling Inside interfaceController.m + (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo, NSError *error)) reply; // launches containing iOS application on the phone. userInfo must be non-nil iOS Code Calling Inside Appdelegate.m - (void) application:(UIApplication *) application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply The answer is actually pretty interesting. It is YES

Launch host app from watch app

好久不见. 提交于 2019-11-28 18:55:20
I know that the openParentApplication api in watch kit extension can open the host app in the background but not in the foreground. I also tried using openUrl() api of NSExtensionContext as below: NSExtensionContext *ctx = [[NSExtensionContext alloc] init]; NSURL *url = [NSURL URLWithString:@"myScheme://today"]; [ctx openURL:url completionHandler:^(BOOL success) { NSLog(@"fun=%s after completion. success=%d", __func__, success); }]; [ctx completeRequestReturningItems:ctx.inputItems completionHandler:nil]; Here too the host app is not launched. Am I missing something? or is it not possible to

Debug WatchKit on real Apple Watch - Nothing happens

血红的双手。 提交于 2019-11-28 17:49:54
问题 I am struggling with debugging my WatchKit Extension/App on a real Apple Watch. Debugging both the iPhone App and the WatchKit Extension using the simulator the simulator is not problem: Select the WatchKit App Profile and run in Simulator ==> App is launched on in Watch Simulator and I can use breakpoints in the Extension code to debug. To debug the iPhone app as well I launch the app in the simulator and attach the debugger manually ==> I can use breakpoints in the iPhone Code to debug. It

Open WatchKit application from iOS

冷暖自知 提交于 2019-11-28 14:22:45
I would like to open WatchKit application to the foreground (or Glance if it is possible) directly from my iPhone. I've been playing with it, but have no success. Maybe someone have found some workarounds? So answer is No, you can't open Watchkit App from iPhone . The WatchKit extension can only request the system to launch the parent iPhone app, which it will run in the background. There is currently no support for this to work the other way around. Nope, Its not possible as of now. Let's hope Apple add that support & release it in coming WWDC. The iPhone app can't launch the Apple Watch app

Call ExtensionDelegate to create/refresh data for Complication

一笑奈何 提交于 2019-11-28 14:15:05
All my data creation is done in the ExtensionDelegate.swift . The problem is ExtensionDelegate.swift doesn't get called before the function getCurrentTimelineEntryForComplication in my ComplicationController.swift . Any ideas? Here is my code and details: So my array extEvnts is empty in my ComplicationController.swift : func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { let extEvnts = ExtensionDelegate.evnts } Because my ExtensionDelegate.swift hasn't gotten called yet, which is what creates the data for

Watchkit & Realm 0.92.3

☆樱花仙子☆ 提交于 2019-11-28 14:12:41
The Swift integration of a new Realm-DB (realm 0.92.3) under Xcode 6.3 and iOS10.10.3 basically works for the iPhone (not for the Apple-Watch yet). The integration of the same realm-framework under Watchkit (i.e. Apple-Watch) does not work yet. The RealmSwift.framework is integrated (dragged into) the Embedded-Binaries as described here1 and here2 . See screenshot below : When running the Watchkit-App with the simulator the following error occurs : dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /Users/XXX/Library/Developer/CoreSimulator/Devices/3FE99-9-4C4C2/data

Create imageView programmatically in Watch Kit

霸气de小男生 提交于 2019-11-28 13:39:23
i'm trying to create an image view for a watch app, i'm trying to create programmatically but the code used in a classic view controller doesn't work. let imageName = "yourImage.png" let image = UIImage(named: imageName) let imageView = UIImageView(image: image!) imageView.frame = CGRect(x: 0, y: 0, width: 50, height: 50) view.addSubview(imageView) how i can do the same thing for watch kit? thanks You can't dynamically create views in WatchKit. You need to create your entire interface in a storyboard. You can have elements of your storyboard hidden and then programmatically unhide them. In

Submit WatchKit Provisioning Error

旧时模样 提交于 2019-11-28 12:47:25
Currently i try to submit a new app to the store with Xcode 6.2 This App includes a WatchKit Extension. All works fine, but all the time i get one error while submit/validate. In iTunes Connect i created a App with the BundleID etc Also i if check my developer portal there is a provisioning profile with the name "Datulator WatchKit Extension". Anyone can explain me what i m doing wrong? I had the same problem. Here is the solution that worked for me. Technical Q&A QA1830 The beta-reports-active Entitlement Q: How do I resolve the "beta-reports-active" code signing error? https://developer

Using WCSession with more than one ViewController

こ雲淡風輕ζ 提交于 2019-11-28 12:11:54
I found many questions and many answers but no final example for the request: Can anyone give a final example in Objective C what is best practice to use WCSession with an IOS app and a Watch app (WatchOS2) with more than one ViewController . What I noticed so far are the following facts: 1.) Activate the WCSession in the parent (IOS) app at the AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Any other code you might have if ([WCSession isSupported]) { self.session = [WCSession defaultSession]; self.session.delegate