watchkit

Trying to get button to spin in WatchKit

情到浓时终转凉″ 提交于 2019-12-02 09:50:18
the code i'm using works just fine in swift for iPhone apps but not in the WatchKit 7.0 beta. the outlets and actions are different. I'm not sure what needs to change to make it work in WatchKit. please help! import WatchKit import Foundation class InterfaceController: WKInterfaceController { @IBOutlet var spinButton: WKInterfaceButton! var isRotating = false override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) // Configure interface objects here. } override func willActivate() { // This method is called when watch view controller is about to be visible to user

Max memory usage on watchOS 2?

女生的网名这么多〃 提交于 2019-12-02 09:32:06
I didn't find anything regarding the memory usage availavable for an app in watchOS 2. I'm currently developing an app for watchOS and I'm using Core Data in the watch side. When I load 166 of 189 objects to an array, the app crashes, the memory usage at that point is 34mb. As the watch has 512mb of memory I'm not entirely sure how much can you use with just one app. I'm gonna improve my code's performance and ram usage but eitherway I still don't know what amount of memory can I use as it's not availavable on Apple Developer portal as far as I know. Would appreciate information regarding this

WatchKit Option to ONLY Dictate?

假装没事ソ 提交于 2019-12-02 09:31:43
问题 I use: NSArray* initialPhrases = @[@"Let's do lunch.", @"Can we meet tomorrow?", @"When are you free?"]; [self presentTextInputControllerWithSuggestions:initialPhrases allowedInputMode:WKTextInputModePlain completion:^(NSArray *results) { if (results && results.count > 0) { id aResult = [results objectAtIndex:0]; // Use the string or image. } else { // Nothing was selected. } }]; This is the example given for text input by Apple. However, in my app, I want the user to ONLY have the option to

Detecting Apple Watch in iOS 8

牧云@^-^@ 提交于 2019-12-02 08:14:00
I have some events that should only be fired off if a user has an Apple Watch. Is there a way to detect whether a watch is paired? I'm not sure if I can use the shared app group to detect the Apple Watch extension or maybe I can use bluetooth? The best you an do is set a BOOL to true in shared NSUserDefaults the first time the Watch app is run and then check for that value in your iOS app. All indications on the dev forums and publicly have been that there isn't a way to programatically know if a Watch has been paired. This is possible on watchOS2.0+ I tried to give an answer here https:/

Pass data from Parse tableview to WatchKit

帅比萌擦擦* 提交于 2019-12-02 08:04:00
I'm using Parse to create this table view , and am trying to figure out how to get the table data, so I can pass it into the WatchKit InterfaceController . (Would I need to query Parse to somehow get and store the data in an array which I would then be able to call from the WatchKit InterfaceController awakeWithContext ?) Here is what I have, let me know if I can add anything that would be helpful: TableVC.m : - (id)initWithCoder:(NSCoder *)aCoder { self = [super initWithCoder:aCoder]; if (self) { self.parseClassName = @"na"; self.textKey = @"dateTime"; self.pullToRefreshEnabled = YES; self

Communicating Updates between iPhone and Watch with SharedData

自闭症网瘾萝莉.ら 提交于 2019-12-02 07:28:54
问题 I have a shared core data backing my iPhone app and WatchKit Extension. They both function well independently, but I'm worried about concurrent use. In the Extension, I have a UITableView that has an array of data. Right now it just grabs that array from the shared core data during -awakeWithContext . I want to have some sort of communication between the app and extension when a record is created/updated/deleted so that it can be duplicated on the other side immediately (instead of on the

WatchKit 2 Complication Text Only Shows Up in Preview

旧时模样 提交于 2019-12-02 07:18:56
问题 I'm trying to develop a very simple complication for watchkit2 that says "Hi" from a simple text provider. I've managed to achieve some strange behavior; I can see the text when the complication is clicked or when you are previewing it from the customize watchface screen, but not when the watchface is displayed. Have a look: Any ideas what might be causing this? My text provider looks like this var textProvider: CLKSimpleTextProvider override init() { textProvider = CLKSimpleTextProvider()

Communicating Updates between iPhone and Watch with SharedData

守給你的承諾、 提交于 2019-12-02 07:17:57
I have a shared core data backing my iPhone app and WatchKit Extension. They both function well independently, but I'm worried about concurrent use. In the Extension, I have a UITableView that has an array of data. Right now it just grabs that array from the shared core data during -awakeWithContext . I want to have some sort of communication between the app and extension when a record is created/updated/deleted so that it can be duplicated on the other side immediately (instead of on the next query to Core Data). This question, How to send data from iphone to watchkit in swift , goes into the

How to build an application with the watchOS 2 SDK

老子叫甜甜 提交于 2019-12-02 06:32:29
In the last submission of our application, we have received this warning : Invalid WatchKit Support - Starting April 1, 2018, all apps submitted to the App Store for Apple Watch must be built with the watchOS 2 SDK or later My question is to know how to to build the application with the watchOS 2 SDK? I was thinking that is enough to build with XCODE 9. Thank's. Check your Deployment Target. It's likely it wasn't updated just by using a newer version of Xcode. Also try checking Base SDK in Build Settings of your Watch Extension to make sure it is up to date. 来源: https://stackoverflow.com

WatchKit return reply() inside a block in handleWatchKitExtensionRequest:

本小妞迷上赌 提交于 2019-12-02 05:55:12
问题 I saw this SO post where apparently data was being fetched and returned to the Watch extension like so: - (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void ( ^)( NSDictionary * ))reply { if ( [[userInfo objectForKey:@"request"] isEqualToString:@"getData"] ) { // get data // ... reply( data ); } } But when I try to call 'reply()' inside a block after getting network data like so: __block UIBackgroundTaskIdentifier watchKitHandler