watchkit

Apple Watch page based interface overflowing on initial controller

匆匆过客 提交于 2019-12-11 02:21:12
问题 While creating an Apple Watch app I noticed something strange. My Initial Controller is always vertically overflowing when using a page based interface. If I remove the 'next-page segue' everything works fine. The strange thing is that even empty controllers will overflow and all the following controllers won't. It seems to appear on the initial controller only. Is there someway to stop this vertical overflow? 回答1: I just verified @Ashraf's findings...this appears to be a regression with the

WKInterfaceSwitch or WKInterfaceButton in a table row — which row was touched?

你。 提交于 2019-12-11 02:06:11
问题 I have a table in my Apple Watch app with rows that include a WKInterfaceSwitch. There are 10 rows of the same row controller, which includes a switch. In other words, there are 10 switches in 10 different rows of a table where each row is an instance of the same row controller. When a user touches a switch and changes its state, the action method is called, but a reference to the switch is not passed, only its new value. Similarly for WKInterfaceButton -- unlike UIKit, no reference is passed

WKInterfaceTable inside WKInterfaceGroup with static BG image behind?

半腔热情 提交于 2019-12-11 01:29:56
问题 I’m trying to display a static background image behind a scrolling WKInterfaceTable , that could contain one or more rows. I’m trying to do this by placing the table inside a WKInterfaceGroup , and setting that group’s background image. The issue is that if I set the group’s height to “Size to fit content”, the table will not scroll, and if I set the group’s height to “Relative to container”, the image does not take up the full display if there is only one row. Is there a clever way around

Synchronizing Apple Watch and iPhone using Swift 3 and Realm

时光毁灭记忆、已成空白 提交于 2019-12-11 01:27:52
问题 I need to Display and modify my data structure from both Apple Watch and iPhone. The Database: I am currently using a simple Realm Structure where I have an Object A and an Object B which can hold lots of A's. So on iPhone the user can create a B and add A's and view of course all A's and B's. I want the Apple watch to show all A's of the current B and give the users the chance to add new A's to their current B. The way I have tried to do it: I wanted to move the hole Realm file from iPhone

How can I get a [Glance] Interface Controller / blank slate for Apple Watch?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 23:16:31
问题 In the default storyboard for an Apple Watch application, the Interface Controller has a black rectangle at the top with the time, and the Glance Interface Controller has two Groups. I would like for both to have the viewport completely covered by my imagery, with a background image that exactly fits the Apple Watch viewport, and a UIImageView portraying a partially transparent PNG, rotated and translated. I've so far tried and failed to find out how to manipulate XCode's UI to delete e.g.

How to get the Apple Watch hardware identifier?

蓝咒 提交于 2019-12-10 22:41:45
问题 This page http://theiphonewiki.com/wiki/Models seems to suggest that the identifiers for the new apple watches are "Watch 1,1" and "Watch 1,2" Does anyone know how to get this identifier in code for a connected watch? [WKInterfaceDevice currentDevice] seems to only give me the screen bounds. 回答1: There is no WatchKit method to obtain the hardware identifier. To distinguish between the 38mm and 42mm Watches, an Apple employee in the dev forums recommended using the screenBounds property on

How to make a phone call from Apple watch?

瘦欲@ 提交于 2019-12-10 21:58:15
问题 Is there a way to make phone calls from WatchKit extension? Below is my code. NSExtensionContext *ctx = [[NSExtensionContext alloc] init]; NSString *cleanedString = [[@"1234567890" componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789-+()"] invertedSet]] componentsJoinedByString:@""]; NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", cleanedString]]; [ctx openURL:telURL completionHandler:^(BOOL success) { NSLog(@"fun=%s

How to get Apple Watch Unique id or UDID or Serial Number Programatically?

最后都变了- 提交于 2019-12-10 18:04:20
问题 I want to read any unique info like UDID or serial number programmatically in apple watch. Is there any way to get it ?? I want to get programatically not manually via xcode.. 回答1: WatchOS3 does not have any UIDevice -like API to get even identifierForVendor or advertisingIdentifier , not talking about UDID. If you need something unique to concrete watch device, workaround I can suggest is putting random UUID to watch's Keychain on first launch and use it as if it was UDID. Theoretically,

iOS - App icon is not showing in Watch Companion app

早过忘川 提交于 2019-12-10 16:27:25
问题 For some reason my icon of app has never appeared in companion app for Apple Watch . Icon is appearing in iPhone and Apple Watch Dashboard. I have provided 58*58(29*29@2x) and 76*76(29*29@3x) which are required for Companion Settings. From Target Watch, i have selected my asset for Apple Watch. After doing all that still the icon is not appearing in Companion Settings. What i need to do to make it appear? 回答1: The WatchKit does not share the Images.xcassets file from the main target app. When

How do I detect the Apple Watch screenshot event/digital crown + side button press?

无人久伴 提交于 2019-12-10 15:47:22
问题 The native workout app and Sportstracker for example have the ability to pause the workout when a user presses both the digital crown and the side button at the same time, AKA taking a screenshot. I need something like this but I can't find anything about it in the docs or anywhere else online. For iOS there's the "notificationUIApplicationUserDidTakeScreenshot", but that doesn't work on watchOS. Anyone know how to do this? Is it publicly available or is this a private API? Did I not look