watchkit

Watchkit & Realm 0.92.3

为君一笑 提交于 2019-11-27 08:22:32
问题 The Swift integration of a new Realm-DB (realm 0.92.3) under Xcode 6.3 and iOS10.10.3 basically works for the iPhone (not for the Apple-Watch yet). The integration of the same realm-framework under Watchkit (i.e. Apple-Watch) does not work yet. The RealmSwift.framework is integrated (dragged into) the Embedded-Binaries as described here1 and here2. See screenshot below : When running the Watchkit-App with the simulator the following error occurs : dyld: Library not loaded: @rpath/libswiftCore

WatchKit SDK not retrieving data from NSUserDefaults

佐手、 提交于 2019-11-27 08:15:57
I wanted to make a test app for the Apple watch in which you can set some String on your phone, and then it will be displayed on the Apple Watch. I decided to use NSUserDefaults class to store this data. In my view controller for the iPhone I have a method which takes the input and stores into local storage: - (IBAction)saveInfo:(id)sender { NSString *userInput = [myTextField text]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:userInput forKey:@"savedUserInput"]; [defaults synchronize]; self.myLabel.text = [defaults stringForKey:@"savedUserInput"]; }

Create imageView programmatically in Watch Kit

ぃ、小莉子 提交于 2019-11-27 07:48:32
问题 i'm trying to create an image view for a watch app, i'm trying to create programmatically but the code used in a classic view controller doesn't work. let imageName = "yourImage.png" let image = UIImage(named: imageName) let imageView = UIImageView(image: image!) imageView.frame = CGRect(x: 0, y: 0, width: 50, height: 50) view.addSubview(imageView) how i can do the same thing for watch kit? thanks 回答1: You can't dynamically create views in WatchKit. You need to create your entire interface in

Debug on real Apple Watch: Application Verification Failed

倖福魔咒の 提交于 2019-11-27 07:02:47
I tried to debug my WatchKit app on a real Apple Watch today. After hitting the Debug button in Xcode, the main iPhone app was installed properly, but the Apple Watch only displayed the message Failed to install xxx, error: Application Verification Failed . The WatchKit app doesn't install. I was aware of this: WatchKit App Rejected for "Failing to Install" , but it didn't help because my Xcode project file is alright. How to make debug work on a real Apple Watch? It turns out you also have to add the UDID of the Apple Watch to the Apple Developer Portal, and update your Development

Using WCSession with more than one ViewController

 ̄綄美尐妖づ 提交于 2019-11-27 06:12:26
问题 I found many questions and many answers but no final example for the request: Can anyone give a final example in Objective C what is best practice to use WCSession with an IOS app and a Watch app (WatchOS2) with more than one ViewController . What I noticed so far are the following facts: 1.) Activate the WCSession in the parent (IOS) app at the AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Any other code you

How to Handle Action Buttons in Push Notifications

岁酱吖の 提交于 2019-11-27 05:38:13
问题 Working on Apple Watch Notifications:- so if i add button in Notification Interface (from object Lib) then the error is : Buttons are not Supported in Notification Interface PushNotificationPayload.apns has the WatchKit Simulator Actions Like This : "WatchKit Simulator Actions": [ { "title": "View", "identifier": "firstButtonAction" } ], and the Simulator Shows this to me Now my Question is, How can I Handle this View Button when send a PushNotification from server, If the aps file contain

Watchkit AppIcon - The app icon set named “AppIcon” did not have any applicable content

隐身守侯 提交于 2019-11-27 05:07:30
问题 There is the Images.xcassets file in my WatchKit App. As soon as I put any icon in that asset build failed with the error message: "The app icon set named "AppIcon" did not have any applicable content." 回答1: This is an easy method to generate your WatchKit icons, which worked well for me: Upload a source image to http://makeappicon.com Go to Images.xcassets in the WatchKit app Right click on the pane which includes AppIcon, select "Import...", and choose the watchkit folder that makeappicon

Is transferCurrentComplicationUserInfo more suitable for complication update?

送分小仙女□ 提交于 2019-11-27 04:56:12
What is the difference between transferCurrentComplicationUserInfo and transferUserInfo ? I want to send data from my AppDelegate to a clock kit complication. transferCurrentComplicationUserInfo seems to do exactly the same thing as transferCurrentUserInfo . Am I missing something? The distinction between these two WCSession methods involve when the data is sent, and whether the watchkit extension is woken up or not. transferCurrentComplicationUserInfo: is specifically designed for transferring complication user info meant to be shown on the watch face right now. The complication user info is

Can't install WatchKit app on Apple Watch

蹲街弑〆低调 提交于 2019-11-27 04:23:38
问题 I have a WatchKit app that runs fine in the Simulator. But when I try to run it on an actual device it never finishes installing and never provides any error message or feedback. The iOS app installs and runs fine. I bring up the Apple Watch app on the iPhone and it lists the app and shows the correct icon. Selecting that, the "Show App on Apple Watch" switch is on. Underneath it it says, "Installing...". And it stays there. I can also see the app icon on the Apple Watch. Selecting it just

Is there an ActivityIndicator in WatchKit for Apple Watch?

不想你离开。 提交于 2019-11-27 04:00:46
问题 Is there an ActivityIndicator (or something like it) in WatchKit for Apple Watch? How do you all give the user feedback about some longer lasting background activity? 回答1: Edit : This answer was originally posted prior to the introduction of Apple Watch models with cellular and wifi connectivity, and thus may no longer apply on newer models of the device (considering significant performance improvements). This thread on the Apple Developer forums has an authoritative answer from an Apple