apple-watch

Scroll long text inside WKInterfaceLabel?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 02:19:11
问题 Simple question: is there a way to make a WKInterfaceLabel scroll if its text is too long to fit within the label’s frame? Something akin to a UITextView ? 回答1: You can definitely do this. All you need to do is set the following properties on the WKInterfaceLabel in the Storyboard. Label => Lines = 0 (WatchKit will set the right number) Size => Width = "Relative to Container" Size => Height = "Size to Fit Content" This will let you scroll to your heart's content. I just mocked it up in a

Can a real iOS device and Watch Simulator communicate for Testing purposes

心不动则不痛 提交于 2020-01-02 01:16:05
问题 I want to create a watch app for an existing iOS app. But I am in a situation that i don't own a apple watch and my existing iOS app will run only on real devices not on simulator. Is it possible to run the app on the iphone device and test my watch app in the watch simulator? 回答1: Pairing a real iPhone and a Watch simulator is not possible at least at the moment. I make this conclusion because of 3 reasons: A Watch simulator automatically pairs to an iPhone simulator during the installation

watch OS3 , UIRequiredDeviceCapabilities issue during ITC review

江枫思渺然 提交于 2020-01-01 11:00:35
问题 During testflight review, I run into the following issue: From Apple 2. 3 PERFORMANCE: ACCURATE METADATA Performance - 2.3 We were unable to install the app extension on an Apple Watch running OS3. The UIRequiredDeviceCapabilities key in the Info.plist is set in such a way that the app will not install on an Apple Watch running OS3. Next Steps Please check the UIRequiredDeviceCapabilities key to verify that it contains only the attributes required for your app features or the attributes that

Max memory usage on watchOS 2?

亡梦爱人 提交于 2019-12-31 06:54:41
问题 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

How to add a label to AppleWatch programmatically?

你说的曾经没有我的故事 提交于 2019-12-31 04:00:27
问题 I'm new to AppleWatch development but I find I can't add a label (or button) to AppleWatch screen programmatically. All I can do is just adding the assets via storyboard. Can I ask how to add label or button to the screen programmatically? And how to set their position to x and y on the screen? Objective C solution is preferred. Thank you! 回答1: You can't. View hierarchy in Apple Watch development is statically declared in storyboards at compile time. If you want a label to be conditionally

Compare WKInterfaceLabel Text to Another NSString

六眼飞鱼酱① 提交于 2019-12-30 11:59:44
问题 I know there is no getter method for WKInterfaceLabel, but is there another way for me to compare the label text to another string? If this wasn't a watch app and I was using UILabel I could just do this: if ([self.label.text isEqualToString:someString]) { } 回答1: There's no supported way to get the text, just as you said, however you may want to use the accessibility elements as "option". Here's the idea: When self.label text is set (either in code or storyboard) also set the corresponding

Why does my WatchKit extension cause a “Waiting to attach” message on an actual Apple Watch but not in a simulator?

自闭症网瘾萝莉.ら 提交于 2019-12-30 06:44:21
问题 I have a published iOS app and am trying to add a WatchKit extension for it. For now, all I have is a watch interface.storyboard with a single label just to verify the entire building process. The app runs fine on the simulator (iPhone 6 (8.3)) and the Watch simulator . When I run it on the iPhone and Apple Watch, it runs on the iPhone, installs on the Apple Watch, but then just displays a wait status when trying to run it on the Apple Watch. The error in Xcode says "Waiting to attach" , and

Why does my WatchKit extension cause a “Waiting to attach” message on an actual Apple Watch but not in a simulator?

霸气de小男生 提交于 2019-12-30 06:44:10
问题 I have a published iOS app and am trying to add a WatchKit extension for it. For now, all I have is a watch interface.storyboard with a single label just to verify the entire building process. The app runs fine on the simulator (iPhone 6 (8.3)) and the Watch simulator . When I run it on the iPhone and Apple Watch, it runs on the iPhone, installs on the Apple Watch, but then just displays a wait status when trying to run it on the Apple Watch. The error in Xcode says "Waiting to attach" , and

Apple Watch App Fails Submission Invalid Info.plist and Icon

主宰稳场 提交于 2019-12-30 04:24:07
问题 I am trying to submit my Apple Watch App to Apple. When validating, it always fails with various info.plist issues. One of these says: The key ‘CFBundleIcons~ipad’ in bundle iPrayed.app/PlugIns/iPrayed WatchKit Extension.appex/iPrayed WatchKit App.app is invalid. Also, I get various errors as well about Invalid icon names. I have searched for these, but I don't see them anywhere. Also, the CFBundleIcons key in the Watch App never shows on the Info.plist I have in there. What am I doing wrong?

Gesture recognition in Apple Watch (WatchKit)

China☆狼群 提交于 2019-12-29 07:52:10
问题 I'm looking for how to detect gestures in an Apple Watch app, via the WatchKit SDK. In iOS we can use some code like this: - (void)viewDidLoad { ... UISwipeGestureRecognizer *swipeRightBlack = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(slideToRightWithGestureRecognizer:)]; swipeRightBlack.direction = UISwipeGestureRecognizerDirectionRight; [self.viewBlack addGestureRecognizer:swipeRightBlack]; } ...but this doesn't work in the Apple Watch simulator. Is there a way