apple-watch

Programmatically notification on apple watch. (WatchOS 3)

冷暖自知 提交于 2019-12-08 12:07:19
问题 How I can programmatically make the notification appear only on the apple watch and only when the event occurs. I searched for a long time on the Internet and in the documentation but did not find the answer 回答1: There is no way for you to decide whether the notification appears on the Watch or on the Phone, the system handles this automatically and you cannot change this behaviour. The notification only appears on the Watch if all of the below requirements are met: The connected iPhone's

Apple Watch Not Passing Data to iPhone - Swift

烈酒焚心 提交于 2019-12-08 07:34:14
问题 I'm trying to pass a String from my Apple Watch to an iPhone but it seems like it's not connecting. Here's my code: ViewController.swift : import UIKit import WatchConnectivity class ViewController: UIViewController, WCSessionDelegate { @IBOutlet weak var lablel: UILabel! var string = "Hello World" let session = WCSession.default() override func viewDidLoad() { super.viewDidLoad() session.delegate = self session.activate() } func session(_ session: WCSession, didReceiveMessage message:

WatchKit Extension Provisioning Profile?

回眸只為那壹抹淺笑 提交于 2019-12-08 05:46:21
问题 I'm trying to send my iOS app to the App Store right now. It compiles fine and installs onto my test device without a single error or even warning. I have an Apple Watch App that is going to go along with it but it seems to be giving me problems. When I create the Archive of the app, I get the following 5 warnings: [App Name] WatchKit Extension warning: skipping copy phase strip, binary is code signed: /Users/***/Library/Developer/Xcode/DerivedData/***/Build/Intermediates/ArchiveIntermediates

Obtain the path of app Group from FileManager

China☆狼群 提交于 2019-12-08 04:50:59
问题 I am trying to update my app for WatchKit and I save a NSKeyedArchiver file to the NSDocumentsDirectory normally. With updating to app groups I need to store it in the app groups folder. The issue I am having is I cant figure out how to just get the path, and not have it referenced as a file I am looking for. The way it is set up now is to find the file it gives the path as a NSString /Users/ME/Library/Developer/CoreSimulator/Devices/43F/data/Containers/Data/Application/5E/Documents/fav but

How to test different font sizes (dynamic type) on the watch?

半世苍凉 提交于 2019-12-08 03:22:32
问题 Apple watch supports Dynamic Type (e.g. by using text styles such as body or footnote). Assuming I have labels that use these custom text styles, how can I test their behavior on the simulator? On an iPhone simulator, I can launch Settings > General > Larger Text and adjust the slider to see how my app looks depending on different font sizes. How can I do the equivalent for my Apple Watch app running on the simulator? 回答1: No possibility yet. Just set it to bold and some points larger in your

Detect physical movement of iPhone/Apple Watch

℡╲_俬逩灬. 提交于 2019-12-08 02:27:14
问题 I'm trying to detect the movement (to the right or left) performed by users. We assume that the user starts with his arm extended in front of him and then moves his arm to the right or to the left (about 90 degrees off center). I've integrated CMMotionManager and want to understand detecting direction via startAccelerometerUpdatesToQueue and startDeviceMotionUpdatesToQueue methods. Can anyone suggest how to implement this logic on an iPhone and then on an Apple Watch? 回答1: Apple provides

Apple watchOS 2 Accelerometer

ぃ、小莉子 提交于 2019-12-07 16:18:19
问题 I am thinking of making a watchOS2 app that uses the accelerometer. If the app is running in the background, will it still be able to receive input from the accelerometer or CMMotionManager ? 回答1: You are able to access live accelerometer data only when the watchOS2 app is running. You could however access accelerometer historical data, i.e accelerometer data from when your app was in the background. Watch this WWDC talk for more information: Whats new in Core Motion 来源: https://stackoverflow

WatchKit Extension Provisioning Profile?

人走茶凉 提交于 2019-12-07 15:53:25
I'm trying to send my iOS app to the App Store right now. It compiles fine and installs onto my test device without a single error or even warning. I have an Apple Watch App that is going to go along with it but it seems to be giving me problems. When I create the Archive of the app, I get the following 5 warnings: [App Name] WatchKit Extension warning: skipping copy phase strip, binary is code signed: /Users/***/Library/Developer/Xcode/DerivedData/***/Build/Intermediates/ArchiveIntermediates/***/IntermediateBuildFilesPath/UninstalledProducts/*** Watch App.app/_WatchKitStub/WK warning:

iWatch: WKInterfaceLabel is it possible to stop text from being cut off with “…” at the end of a label?

给你一囗甜甜゛ 提交于 2019-12-07 13:38:29
问题 The text in my WKInterfaceLabel is way too long and causes the text to be cut off with dots at the end. I know for UILabel for iOS you can easily resolve this issue by enabling clip mode. I don't believe there is any way for me to resolve this for watchkit. This is going to force me to use an Image if I can't prevent the text from being cut off. Any tips or suggestions is appreciated. 回答1: You have a couple options depending on how you want the view to respond. In your interface story board

Page number in Page-Based Interface with WatchKit (Watch)?

怎甘沉沦 提交于 2019-12-07 10:08:37
问题 I created a WatchKit app with a Page-Based Interface. There are 3 pages and each one is connected to my InterfaceController.swift class (which extends WKInterfaceController ). My question: inside InterfaceController.swift how can I detect the page number of the current view? 回答1: If you use func presentControllerWithNames(_ names: [AnyObject], contexts contexts: [AnyObject]?) You just have to pass the number of the page in the context, so you can store it, and retrieve it later on. This is