watchkit

Not able to set custom fonts in WatchKit

三世轮回 提交于 2019-12-01 01:20:19
I am trying to set Roboto font and have added as target for watch kit extension, but it is still coming as nil. Can we set custom fonts in watch kit. Yes, you can use custom fonts in WatchKit https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/TextandLabels.html Yano Ratheez Its worked for me.. Using following Codes. Add the custom Font to both WatchKit Extension and WatchKit App target Info.plist Now you write the code following way, NSMutableAttributedString *attString =[[NSMutableAttributedString alloc] initWithString: @"Yano rocks!

How to pass UIImage from iPhone app to Apple Watch app

十年热恋 提交于 2019-12-01 01:12:50
I have an iPhone app that captures a UIView as UIImage after 5-10 seconds. Is it possible to pass that UIImage to my Apple Watch app and show it in UIImageView there? Dejan Skledar Yes it is. All you need to do is create a NSDictionary like: var dict:[NSString : UIImage] = ["image" : yourImage] And then you just use the following methods to communicate between the Apple Watch and the iOS app: LINK The answers here are only half correct cause you can't send an UIImage directly! You need to send your images as NSData like f.e. so: - (void)application:(UIApplication *)application

Does WatchKit support html? is there is controller like UIWebview?

流过昼夜 提交于 2019-12-01 00:50:08
Does WatchKit support html? is there is controller like UIWebview ?. My client want to show webpage in a Apple Watch. is this possible ? There's no UIWebView in WatchKit (neither WatchOS 1 nor WatchOS 2 ). However, it's fully possible to work around this: You can load the HTML , pick out the relevant content, and display that in for example a Label . This is however not a smart solution, as the website owners can change its layout and render your app useless until you update it. My suggestion is to send a GET -request to the server and receive the relevant data in JSON -format if they have an

Images on apple watch

不羁岁月 提交于 2019-11-30 23:04:37
I ran into a problem yesterday when my application was rejected. Apparently the images are not being displayed on the actual Apple Watch, however they are being displayed in the simulator. I even tried resetting the simulator and can't replicate the problem that occurred for the apple employee. So I am just wondering what the correct way to add/display images on the apple watch is, such so that they will be displayed properly on the actual hard device? Code: .h @property (strong, nonatomic) IBOutlet WKInterfaceImage *imageHeliLeft; @property (strong, nonatomic) IBOutlet WKInterfaceImage

watchOS - Show realtime departure data on complication

拈花ヽ惹草 提交于 2019-11-30 22:37:49
I have an public transport app with realtime departure data for trains. I would like to add a complication that shows the departure time of the next train. Is it possible to show (or refresh) realtime data on a complication? For example, showing "3 min. to station X." The data could change every minute, based on info that comes from the public transport API. How should I accomplish this on watchOS 2 or watchOS 3? I know the ETA app shows travel times in a complication, but I'm not sure how they achieve that. Are realtime updates possible? Complications aren't designed to show realtime data.

Using Core Location in Apple WatchKit

混江龙づ霸主 提交于 2019-11-30 22:13:24
I'm currently developing an apple watch extension. Anybody knows if the current location is provided by iPhone or Watch itself? I can't find any information about this and i need to draw a compass pointing where the watch is pointing. In order to do what you want you don't need CoreLocation you just need a magnetometer. AFAIK the Apple Watch doesn't have one built in. The sensors it has are... Accelerometer Gyroscope Heart rate sensor Barometer No magnetometer though. According to Apple's Dev Documentation: The best solution for performing any long-running tasks is to let your iOS app perform

Reading NSUserDefaults in watchOS 2 (I know App Groups doesn't work)

≯℡__Kan透↙ 提交于 2019-11-30 21:43:48
Apple documentation says "Also, iOS automatically forwards a read-only copy of your iOS app’s preferences to Apple Watch. Your WatchKit extension can read those preferences using an NSUserDefaults object..." . https://developer.apple.com/library/prerelease/watchos/documentation/General/Conceptual/WatchKitProgrammingGuide/SharingData.html#//apple_ref/doc/uid/TP40014969-CH29-SW1 But I can't read defaults in my WatchKit app that were saved in my iPhone app, am I doing something wrong? In the WatchKit app, can I even save to (a WatchKit only) defaults, or does that not even work? iPhone Data : let

Adding a watch app to a Flutter iOS application

≯℡__Kan透↙ 提交于 2019-11-30 21:29:10
I have come across an issue when trying to create a Flutter iOS app with a watch app extension. For testing I have simply created a default Flutter app using flutter create watchapp When this is run I get the standard demo Flutter app. If I then open the ios/Runner.xcworkspace project in Xcode and add a new target to the project (File->New->Target) and selecting watchOS->Watchkit App it will generate the watch app. The problem I have come across is when running the app again (with flutter run) I get the following error. Xcode build done. 1.2s Failed to build iOS app Error output from Xcode

How to pass UIImage from iPhone app to Apple Watch app

一个人想着一个人 提交于 2019-11-30 20:05:49
问题 I have an iPhone app that captures a UIView as UIImage after 5-10 seconds. Is it possible to pass that UIImage to my Apple Watch app and show it in UIImageView there? 回答1: Yes it is. All you need to do is create a NSDictionary like: var dict:[NSString : UIImage] = ["image" : yourImage] And then you just use the following methods to communicate between the Apple Watch and the iOS app: LINK 回答2: The answers here are only half correct cause you can't send an UIImage directly! You need to send

Set WKInterfacePicker color (text or outline)

不想你离开。 提交于 2019-11-30 19:14:29
问题 Does anyone know how to set the Text color or Focus Style Outline color of a WKInterfacePicker ? I don't see it Interface Builder, not am I able to find any property items in code where I can set it. Here's IB: 回答1: You cannot change the color of the default picker. But you can manipulate the views to make it look like it without slowing down the app. I created this with 2 WKInterfaceGroup aligned vertically. The group on top has a WKInterfaceLabel for custom caption label, and the group