watchkit

Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode

独自空忆成欢 提交于 2019-11-26 10:08:49
问题 We\'ve got an Xcode project with build configurations for the Apple Watch as well. Our Apple Watch app isn\'t ready yet, so we\'d like to release with it disabled. What\'s the best way to disable Apple Watch functionality in a build? 回答1: Remove the WatchKit extension To make sure that your WatchKit extension is no longer visible, you have to do two things: 1) Remove the WatchKit extension from "Target Dependencies" (To go to Target Dependencies: in the project navigator, click the project

Heart Rate data on apple Watch

大憨熊 提交于 2019-11-26 09:07:08
问题 Can we access the heart rate directly from the apple watch? I know this is a duplicate question, but no one has asked this in like 5 months. I know you can access it from the Health App but I\'m not sure how \"real-time\" that will be. 回答1: There is no direct way to access any sensors on the Apple Watch. You will have to rely on access from HealthKit. An Apple evangelist said this It is not possible to create a heart monitor app at this time. The data isn't guaranteed to be sent to iPhone in

NSUserDefaults not working on Xcode beta with Watch OS2

丶灬走出姿态 提交于 2019-11-26 06:45:21
问题 I just installed the latest beta of Xcode to try Swift 2 and the improvements made to the Apple Watch development section. I\'m actually having an hard time figuring out WHY this basic NSUserDefaults method to share informations between iOS and Watch OS2 isn\'t working. I followed this step-by-step tutorial to check if I missed something in the process, like turning on the same group for both the phone application and the extension, but here\'s what I got: NOTHING . Here\'s what I wrote for

How do I correctly use “openParentApplication” and “handleWatchKitExtensionRequest” so that “reply()” is called?

≯℡__Kan透↙ 提交于 2019-11-26 04:21:13
问题 Situation: I use openParentApplication in the Watch app to call handleWatchKitExtensionRequest in the main app. This works nicely in the simulator and it also works on the actual devices (Apple Watch and iPhone) when the iPhone app is active/open. Problem: When I run it on the actual devices (Apple Watch and iPhone), handleWatchKitExtensionRequest does not return data to openParentApplication when the main iPhone app is not active/open. Code in InterfaceController.m in the WatchKit Extension:

How can I change image tintColor in iOS and WatchKit

╄→尐↘猪︶ㄣ 提交于 2019-11-26 03:24:45
问题 I have an UIImageView called \"theImageView\", with UIImage in a single color (transparent background) just like the left black heart below. How can I change the tint color of this image programmatically in iOS 7 or above, as per the tint method used in the iOS 7+ Navigation Bar icons? Can this method also work in WatchKit for an Apple Watch app? 回答1: iOS For an iOS app, in Swift 3 or 4: theImageView.image = theImageView.image?.withRenderingMode(.alwaysTemplate) theImageView.tintColor =