apple-watch

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:

How can I share information between my iOS and Watch apps using WatchConnectivity?

五迷三道 提交于 2019-12-03 13:46:43
问题 [Disclaimer: this question is intended to be a wiki question to answer the frequent questions about sending data between the iOS and watch apps under the watchkit and watch-os tags.] I am developing an Apple Watch app and would like to send data between the iOS app and its WatchKit extension . I have looked at the WatchConnectivity framework, but don't really understand the difference between all of its methods. Which function should I use if I want to be able to send data even when my apps

Are iPhone's apps notifications going to be triggered on the Apple Watch by default, without even creating an actual Watch app?

家住魔仙堡 提交于 2019-12-03 13:34:23
问题 I would like to support my iPhone's app Local Notifications in the Apple Watch from the very first moment the Watch is released, but I don't plan on building a Watch App yet. From what I researched, it seems like iPhone's notifications will be automatically supported on the Watch, without needing any additional development or WatchKit implementation. Apps are not required to do anything to support notifications. The system provides a default notification interface that displays the alert

How to create sections in WKInterfaceTable

☆樱花仙子☆ 提交于 2019-12-03 12:52:24
问题 How can we create sections in table as there is no delegate for it. And is there any other way for creating sections or do we have to use two tables. 回答1: WKInterfaceTable is not so flexible like UITableView, but you can create rows manually, using different row types. And fill content for each cell according to its type. Take a look at the documentation: Apple Watch Programming Guide: Tables WatchKit Framework Reference: WKInterfaceTable For example, let's create a table having two row types

Apple Watch set background image

假如想象 提交于 2019-12-03 12:34:10
How can I programmatically set my WatchKit App background image? I need to set this in code as it changes depending on variable size and we need to place a label over the image. It is not possible to programatically set the background image on an entire Watch App page in WatchKit... a background image for the whole page can at the current time only be set in Interface Builder it appears. However, you can set a picture as a background behind a label, and make that image fill the screen: Create a group in your WatchKit scene. You are likely to want to set custom size attributes for the view (e.g

The UIApplicationDelegate in the iPhone App never called reply

放肆的年华 提交于 2019-12-03 12:26:09
I am trying to launch my iPhone app from watch simulator using the below code : WKInterfaceController subclass [WKInterfaceController openParentApplication:[NSDictionary dictionaryWithObject:@"red" forKey:@"color"] reply:^(NSDictionary *replyInfo, NSError *error) { NSLog(@"replyInfo %@",replyInfo); NSLog(@"Error: %@",error); }]; AppDelegate.m - (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo))reply { NSLog(@"appdelegate handleWatchKitExtensionRequest"); NSLog(@"NSDictionary: %@",userInfo); NSLog(@

Dynamic Notification Interface will only work if the Watch app \\ extension was opened at least once from the watch

主宰稳场 提交于 2019-12-03 11:56:57
Currently there are 3 flavors of notifications in the Apple Watch: Short - You can't customize these at all. Static - You can customize these on the Storyboard. Dynamic - Can customize UI elements with new data not coming on the Notification payload. Here's the problem (The project is using Watch OS 1), if the app was never opened from the Apple Watch the Static notification will be displayed instead of the Dynamic one and the log will show the error Took too long to show custom notification. Falling back to static I've stripped down the notifications code & ViewController to nothing but this:

Watchkit - How to set the element one below other in Group

不想你离开。 提交于 2019-12-03 11:35:00
I am working on the watchkit app and I want to create a table row with an image and two labels where the labels are one below the other, like this: I tried the position options in interface builder, but no luck. The labels are always on the same line: I want the x-coordinate same for both. Please help. At first, drag a Group onto the interfaceController, then change the Layout property of that group to Vertical : Then drag the Labels in that group and set their properties accordingly: If you need other alignments, add another group to the viewController. EDIT To achieve the table view you have

WatchOS 2 (beta 5): watchAppInstalled returns false

ⅰ亾dé卋堺 提交于 2019-12-03 11:09:40
The Watch App is installed on the watch and I can tap and run it on the Watch, but watchAppInstalled method returns false. Also, I can only install the Watch App using Xcode 7. If I try to install the Watch App using the Watch iOS app (from Apple) by turning on the switch, the Watch App gets deleted right after the installation completes. Update: This bug is fixed in Xcode 7 beta 6 Apple Documentation says: The session must be configured and activated before accessing this property. So, you should configure and activate the session before using this property. I had same issue. I just add

HKWorkoutSession isn't keeping app at front of Apple Watch

人走茶凉 提交于 2019-12-03 10:05:02
问题 It has been stated that an app running a HKWorkoutSession will have special privileges over other watchOS 2 apps, so when a user looks at their Apple Watch, it will go to the view showing running a workout rather than the watch face. Currently, on both my device and simulator, this is not the case. If I start a HKWorkoutSession and then leave for 5 minutes and then interact with either the Apple Watch, or the Watch Simulator, it presents the watch face. If I then open my app, it appears to