Questions tagged [wkinterfacelabel]

In iOS Watchkit, a WKInterfaceLabel object lets you manipulate the contents of an onscreen label at runtime. Use a label object to set a new text string for the label.

A WKInterfaceLabel object lets you manipulate the contents of an onscreen label at runtime. Use a label object to set a new text string for the label. The string you specify can use the default styling you specified at design time, or you can use an attributed string to add custom styling to the text.

Do not subclass or create instances of this class yourself. Instead, define outlets in your interface controller class and connect them to the corresponding objects in your storyboard file. For example, to refer to a label object in your interface, define a property with the following syntax in your interface controller class:

SWIFT

@IBOutlet weak var myLabel: WKInterfaceLabel!

OBJECTIVE-C

@property (weak, nonatomic) IBOutlet WKInterfaceLabel* myLabel;

Apple Documentation

40 questions
0
votes
1 answer

how can I display labels on apple watch?

Xcode 8.0 I try to code my very first app for watchOS. I simply want to show a note when pressing the button. Here is what I've got so far: import WatchKit import Foundation class InterfaceController: WKInterfaceController { @IBOutlet var…
0
votes
0 answers

WatchKit : presentTextInputControllerWithSuggestion slowed my app

I use a presentTextInputControllerWithSuggestion in my watch app in Swift. It works but my app is really slow after the dictation. There is my code : func dictation() { presentTextInputControllerWithSuggestions([], allowedInputMode: .Plain,…
0
votes
0 answers

WatchKit Can not set the Label title

I have tried to set the WKInterfaceLabel title programmatically but, It is not changing. WKInterfaceLabel *titleLabel; Couldn't set the title by using this, [titleLabel setText:str]; Also tried Attributed string too, NSMutableAttributedString…
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
0
votes
1 answer

WatchKit extension of 7.1 compatible target: WKInterfaceLabel

I am trying to add a WatchKit target to an app still supporting iOS 7.1. I supposed the app and Watchkit versions could use different versions. Yet when I add: @IBOutlet var bus: WKInterfaceLabel! @IBOutlet var location: WKInterfaceLabel! The…
Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75
0
votes
1 answer

Not sure why this basic watchOS 2 app isn't working

This is the first day I am learning how to code. I want to make a simple WatchKit App using watchOS 2. I got the Hello World app up and running and now when I try to have a menu press trigger a label to change, the code won't compile, with the…
0
votes
1 answer

Swift WKInterfaceLabel IBOutlet Freezes Watchkit App at Startup

I am trying to make a simple example of a watch app: a label and a button. Press the button and the text of the label should change. @IBOutlet var myLabel: WKInterfaceLabel! @IBOutlet var myButton: WKInterfaceButton! The following code results in…
Jack Amoratis
  • 653
  • 2
  • 7
  • 22
0
votes
1 answer

Attributed string 'Google' contains NSLinkAttributeName. Removed

I am developing application in apple Watch. I am using label and adding text as link. On that link i want to implement phone call event. I am using following code. [string addAttribute:NSLinkAttributeName value:linkURL …
om Khodke
  • 37
  • 3
0
votes
1 answer

Set different font styles for WKInterfaceLabel with multiple lines

I'm developing an apple watch app - it consists of two tables that contain labels. These labels have two lines of text, I want the second line of text to have a different font style to the top line How can I do this in swift? Thanks everyone
jackchmbrln
  • 1,672
  • 2
  • 14
  • 26
0
votes
1 answer

How to Push Data From one WKInterfaceController to Another?

I have 2 Interface Controllers in my WatchKit. The first one is called InterfaceController while the other is called DetailsForWatch. IC has a tableView on it. It parses data from a Parse class, and displays data from each entry in the class as a…
user717452
  • 33
  • 14
  • 73
  • 149
-1
votes
1 answer

How can I color a part of a WKInterfaceLabel

I have a sentence and I want to color some parts of this sentence. For example "Turn on the lights" will become "Turn on(in blue) the lights(in red)" Do you know if it's possible to make it with a unique label ? If it's not possible, do you know how…
1 2
3