watchkit

Apple Watch: Status bar not visible after presenting a modal screen from page based navigation

前提是你 提交于 2019-12-18 02:42:58
问题 When i present a modal screen from a page in page based navigation, the whole screen shifts up and the status bar is no longer visible. Here is a gif of the issue: I am using xCode 6.2 version. This was not happening in xCode 6.2 Beta 4.. I am not sure if this is a simulator issue or this will actually happen on a real device too. Does anyone have the same issue? Is there a workaround? I reported a bug to apple (20109240) and it was marked as a duplicate of (19862945), and that one is still

How to get the current location in watchOS 2?

流过昼夜 提交于 2019-12-18 02:00:33
问题 I need to fetch the user current location for the WatchKit App in watchOS 2. How do I do this? 回答1: The other answers are incorrect. You can request location directly on the watch for watch OS2. The available method is called requestLocation . It allows you to request a single location update. E.g. #import <CoreLocation/CoreLocation.h> @interface className : WKInterfaceController<CLLocationManagerDelegate> Then where you want to request location: self.locationManager = [CLLocationManager new]

How to export shared container of an iOS App with Xcode6.2?

徘徊边缘 提交于 2019-12-17 23:17:59
问题 In our iOS app we utilize a shared container to share files between our main iOS app and its extension (specifically WatchKit Extension), using [NSFileManager containerURLForSecurityApplicationGroupIdentifier:] method. For debugging purposes we need to access the content of this shared container, so we've tried to export the whole App container using the Devices window in Xcode: But, the Shared storage is not included in the container, probably because it sits in a different path on the

Open WatchKit application from iOS

眉间皱痕 提交于 2019-12-17 21:13:52
问题 I would like to open WatchKit application to the foreground (or Glance if it is possible) directly from my iPhone. I've been playing with it, but have no success. Maybe someone have found some workarounds? 回答1: So answer is No, you can't open Watchkit App from iPhone . The WatchKit extension can only request the system to launch the parent iPhone app, which it will run in the background. There is currently no support for this to work the other way around. 回答2: Nope, Its not possible as of now

Call ExtensionDelegate to create/refresh data for Complication

青春壹個敷衍的年華 提交于 2019-12-17 21:06:07
问题 All my data creation is done in the ExtensionDelegate.swift . The problem is ExtensionDelegate.swift doesn't get called before the function getCurrentTimelineEntryForComplication in my ComplicationController.swift . Any ideas? Here is my code and details: So my array extEvnts is empty in my ComplicationController.swift : func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { let extEvnts = ExtensionDelegate

Submit WatchKit Provisioning Error

↘锁芯ラ 提交于 2019-12-17 20:29:25
问题 Currently i try to submit a new app to the store with Xcode 6.2 This App includes a WatchKit Extension. All works fine, but all the time i get one error while submit/validate. In iTunes Connect i created a App with the BundleID etc Also i if check my developer portal there is a provisioning profile with the name "Datulator WatchKit Extension". Anyone can explain me what i m doing wrong? 回答1: I had the same problem. Here is the solution that worked for me. Technical Q&A QA1830 The beta-reports

How to send data from iphone to watchkit in swift

て烟熏妆下的殇ゞ 提交于 2019-12-17 19:57:19
问题 I am doing a sample project in which i like to send data from iphone to WatchKit. I have no idea of how to do this. Any help will be appreciated. Thanks in advance 回答1: Add this method in the AppDelegate: func application(application: UIApplication!, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) -> Void)!) { //define your dictionary reply(yourDict) } Add this anywhere in the Apple Watch Extension: var dict = ["test" : 4] //your dictionary

iOS get heart rate from Apple Watch in near real time

二次信任 提交于 2019-12-17 18:27:27
问题 I need to make an app that records heart rate data in near real time and send this data to a server as soon as possible. First I took this approach: Watch os 2.0 beta: access heart beat rate In fact it is working fine. There is new heart rate data in the HealthKit every five seconds. But now I have the problem that I can't sync that with a server. My first approach was the Watch app. The watch was sending data to a server. That doesn't work because as soon as the screen turns black on the

Apple Watch, WatchKit Extension and main application

限于喜欢 提交于 2019-12-17 18:26:07
问题 There is main application with logic and we extend app to Apple Watch. After adding target xCode creates 2 more applications: extension with code and watch kit application. Question: How code from extension can reuse logic of ready and already made main iOS app? How extension app can communicate with main App and send commands. 回答1: To communicate to the containing iPhone app you can use (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *replyInfo, NSError

WatchKit: unable to find interface controller class

泄露秘密 提交于 2019-12-17 18:16:12
问题 I tried adding an interface controller to a storyboard, setting its Custom Class to a WKInterfaceController subclass, launched the app in the simulator and navigated to the specified interface controller. When I do so, I get the following error: WatchKit error - unable to find interface controller class 'TestController' to instantiate If I try to interact with the controller (e.g. try launching its button's action), I get the following error: *********** ERROR -[SPRemoteInterface