watchkit

watchOS - Show realtime departure data on complication

醉酒当歌 提交于 2019-12-03 21:23:46
问题 I have an public transport app with realtime departure data for trains. I would like to add a complication that shows the departure time of the next train. Is it possible to show (or refresh) realtime data on a complication? For example, showing "3 min. to station X." The data could change every minute, based on info that comes from the public transport API. How should I accomplish this on watchOS 2 or watchOS 3? I know the ETA app shows travel times in a complication, but I'm not sure how

Images on apple watch

大城市里の小女人 提交于 2019-12-03 21:21:39
问题 I ran into a problem yesterday when my application was rejected. Apparently the images are not being displayed on the actual Apple Watch, however they are being displayed in the simulator. I even tried resetting the simulator and can't replicate the problem that occurred for the apple employee. So I am just wondering what the correct way to add/display images on the apple watch is, such so that they will be displayed properly on the actual hard device? Code: .h @property (strong, nonatomic)

WKInterfaceGroup bottom corner radius

南楼画角 提交于 2019-12-03 21:08:46
I am trying to set the corner radius for the bottom left and bottom right corners for a WKInterfaceGroup. I was able to set only one single radius value and that would change it for all the corners. I couldn't find a way to access the CALayer to specify it there either. Is there a way this can be done? Thanks! (The group would contain 2 labels and would be in contact with the sash in the dynamic notification interface.) You asked about WKInterfaceGroup, but from your response to @BalestraPatrick it sounds like you are specifically trying to achieve bottom corner rounding in the long-look

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

烈酒焚心 提交于 2019-12-03 20:39:29
问题 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

Getting black screen on Watchkit simulator and “Waiting to Attach” when adding to existing project

有些话、适合烂在心里 提交于 2019-12-03 20:33:39
I'm interested in adding a Watchkit Extension to my existing app already in the app store. I've done my research, followed some tutorials, and now am ready to actually implement. The problem I'm having is, I can't seem to add a Watchkit App to my existing project and get it to run in the simulator. If I start a new project and do some tutorials or whatever, the Watchkit App runs fine. Adding to my existing project, I just get a black screen in the simulator window. Not even the status bar is present. http://i.imgur.com/kG7H06i.png Only lead I have so far is: In the debug navigator, I get

Calling a Method on Watchkit

对着背影说爱祢 提交于 2019-12-03 18:12:02
问题 I attended to a watchkit hackathon yesterday and I had some problems regarding calling a method on an NSObject class which uses the Google Maps API and send local notifications. If I call this method from my Watchkit extension, the code doesn't compile, but If I call from the ViewController, for example, everything works perfectly #import "InterfaceController.h" #import "Methods.h" @interface InterfaceController() @end @implementation InterfaceController - (instancetype)initWithContext:(id

iOS WatchKit - how to determine if your code is running in watch extension or the app

北慕城南 提交于 2019-12-03 16:01:34
With WatchKit you have your app that runs on the phone, and the watch app that runs as an extension. If you create a library that contains common code to be used in both the phone app and the watch extension, is there a way to tell if the code is running in the phone app or the watch extension? I.e. if ([self isRunningInWatchExtension]) { NSLog(@"this is running on watch"); } else { NSLog(@"this is running on phone app"); } - (BOOL)isRunningInWatchExtension { ??? } I've accomplished this by checking the bundle identifier: if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString

hide and show WKInterfaceGroup programmatically

為{幸葍}努か 提交于 2019-12-03 14:15:01
问题 I'm using xCode 6.2 beta 2 and tried to hide and show group programmatically but there is no method shown where i can write group.hidden=YES or group.hidden=NO Is there any another method for doing same? 回答1: Yes, there is no property for hide group in WKInterfaceGroup. But there is same property available in WkInterfaceObject which is super class of WKInterfaceGroup. so you can do same like [group setHidden:YES] or [group setHidden=NO] 回答2: If you're using a swift you can use this code:

WKInterfaceTimer used as a timer to countdown start and stop

和自甴很熟 提交于 2019-12-03 13:57:16
I am trying to create a timer to countdown x minutes and y seconds. I am computing the number of seconds and creating the InterfaceTimer like this: timer.setDate(NSDate(timeIntervalSinceNow:Double(secondsValue+1))) timer.stop() after that I keep stoping it and starting it again and again, but the values are suddenly decreasing as "time(now) doesn't stop". Eg: if the timer shows :55, I start it for 3sec and stop it, it shows :52, I wait 10seconds and then start it again, it starts from :42. I can not save the value currently in the WKInterfaceTimer, so that I could start again from the same

WatchKit Core Data Sync Up

假装没事ソ 提交于 2019-12-03 13:54:35
问题 I have an app structured as follows iOS App Writes data to Core Data which has a persistent store stored in a shared app group. The Watch Kit extension is able to read data from Core Data that was written by the iOS app. The issue I am having is if my iOS app writes data while my watch kit app is open I am not getting updates because the object context is not syncing with the data on the disk. Is there a way that since my watch kit extension is only reading data to be able to refresh the