watchkit

should existing watchOS apps be updated?

青春壹個敷衍的年華 提交于 2019-12-11 13:14:53
问题 https://developer.apple.com/news/?id=04222016a The above blog post says "all new watchOS apps submitted". In reference to this blog post. Should I updated my existing watchOS 1 app? Can I update my main app with, leaving the watchOS1 app as it is? 回答1: Just confirmed with apple that, its only for new submissions and existing apps can still update it without supporting watchOS2. 来源: https://stackoverflow.com/questions/36852533/should-existing-watchos-apps-be-updated

What is the best practice to call URL in apple watch?

∥☆過路亽.° 提交于 2019-12-11 12:59:00
问题 What is the best practice to call API from Apple watch use sendMessage "watchConnectivity" from Apple watch to iPhone to call the API or use NSURLSession to call the API from the watch itself ? 回答1: Using the NSURLSession API, the device that performs the request is abstracted from the developer. If the phone is available, it will perform the request on the phone and return it to your watch app as if the watch itself performed the request. If the phone is not available, the watch can perform

Passing UIImage from iPhone to Apple Watch results in nil response in watch

独自空忆成欢 提交于 2019-12-11 12:19:16
问题 My watch needs to request an image from the containing app. In the watch's controller, I have: - (void)getOrgLogo { NSString *host = mfaInfo[@"host"]; NSDictionary *getOrgLogoRequest = @{@"request":@"getOrgLogo", @"host":host}; [MyInterfaceController openParentApplication:getOrgLogoRequest reply:^(NSDictionary *replyInfo, NSError *error) { if (error) { ... } else if (replyInfo == nil) { // I am always getting into this block!!! } else { UIImage *orgLogo = replyInfo[@"orgLogo"]; if (orgLogo !=

WatchKit Image Animation wait for finish

╄→гoц情女王★ 提交于 2019-12-11 12:03:44
问题 I currently looking for a way to wait to finish my Image Animation and then start the next one after it is finished. I thought to use a completion handler but it "does not work for me" is there a way to use it in that case? if X > 1 { self.GroupIMG.setBackgroundImageNamed("single") self.GroupIMG.startAnimatingWithImagesInRange(NSRange(location: 0, length: 300), duration: Repeater, repeatCount: self.X) } //this should start after the if is done self.GroupIMG.setBackgroundImageNamed("single")

WKInterfaceTable rendering issues. Both the scroll bar and last row are cut off

久未见 提交于 2019-12-11 11:43:28
问题 I'm developing a WatchKit app for the Apple Watch. I "finished" the app originally when the first beta was out back in Nov/Dec. I recently upgraded the the final release and somethings in WatchKit changed (as to be expected). I had to fix couple lines of code here and there since they changed how the app views start up. Anyway, after fixing the issues I noticed that my WKInterfaceTable displays and scrolls almost correctly. The last row in the table gets cut off (as indicated in the

How can I dismiss unwanted pages of my two pages consisting interface controller after pushing a new interface over it? On Watchkit

好久不见. 提交于 2019-12-11 11:09:06
问题 I was trying to push an interface after clicking at one button of my two pages consisting rootController and got a weird result. My requested controller (second image) gets pushed over my first page..but, the second page of my root controller is still there and I can segue into it. I don't want this. How can I dismiss all other pages of my several pages controller after pushing a new interface over it?. Modal is not an option as I want to go deeper after pushing this controller. 回答1: WatchKit

SwiftUI: NavigationLink pops immediately if used within ForEach

心已入冬 提交于 2019-12-11 11:00:20
问题 I'm using a NavigationLink inside of a ForEach in a List to build a basic list of buttons each leading to a separate detail screen. When I tap on any of the list cells, it transitions to the detail view of that cell but then immediately pops back to the main menu screen. Not using the ForEach helps to avoid this behavior, but not desired. Here is the relevant code: struct MainMenuView: View { ... private let menuItems: [MainMenuItem] = [ MainMenuItem(type: .type1), MainMenuItem(type: .type2),

Open Parent Application (WatchOS 2.x+)

谁说胖子不能爱 提交于 2019-12-11 10:07:24
问题 I am trying to get an update from the parent app, but I don't want to bring the parent app to the foreground when the request is sent from the Apple Watch. I ultimately would like to bring the parent app to a background state, have it run it's required method and send it back to the watch. Specifically, is there a way to open the parent app and have it reside temporarily in a background state from WatchOS 2.0+? I have looked into this: [WKInterfaceController openParentApplication:

apple watch CMDeviceMotion is not giving me good readings

我与影子孤独终老i 提交于 2019-12-11 10:04:53
问题 Currently, I am just recording a bunch of motion data and saving it to a file. However, when I plot the data, I am having a hard time believing I am getting the right readings. Here is my watch code: - (IBAction)startStopRecording { if (!recording){ NSLog(@"starting to record"); recording = YES; data = [[NSMutableArray alloc] init]; [self.startRecording setTitle:@"Stop Recording"]; if (self.motionManager.deviceMotionAvailable) { [self.motionManager startDeviceMotionUpdatesToQueue:

Can you change the selected page in WatchKit PageView

不羁的心 提交于 2019-12-11 09:55:07
问题 Imagine I have 5 pages, If I'm on page 1 can I programmatically load page 5? I'm aware of using becomeCurrentPage to load the initial page but not of how to switch it (if at all possible). 回答1: You can send post an NSNotificaton whenever you want to switch and have your desired InterfaceController as an observer for this notification. And inside the selector of the observer. call [self beconmeCurrentPage] . It worked for me and i hope it works for you as well. 来源: https://stackoverflow.com