-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNIAttributedLabel.html
More file actions
641 lines (579 loc) · 36.3 KB
/
Copy pathNIAttributedLabel.html
File metadata and controls
641 lines (579 loc) · 36.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6-nimbuskit"/>
<title>NimbusKit: NIAttributedLabel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="appledocs.css" rel="stylesheet" type="text/css"/>
<link href="nimbuskit.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24278774-1']);
_gaq.push(['_setDomainName', 'nimbuskit.info']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<a href="index.html"><img style="float:left" src="nimbus128.png" width="80" height="80" /></a>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">NimbusKit
 <span id="projectnumber">1.2.1 - <a href="http://github.com/jverkoey/nimbus">Fork Nimbus on Github</a> - <a href="http://wiki.nimbuskit.info/">Visit the Nimbus Wiki</a></span>
</div>
<div id="projectbrief">The iOS framework that grows only as fast as its documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6-nimbuskit -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('NIAttributedLabel.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="classNIAttributedLabel-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">NIAttributedLabel Class Reference<div class="ingroups"><a class="el" href="NimbusAttributedLabel.html">Nimbus Attributed Label</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>The <a class="el" href="NIAttributedLabel.html" title="The NIAttributedLabel class provides support for displaying rich text with selectable links and embed...">NIAttributedLabel</a> class provides support for displaying rich text with selectable links and embedded images. </p>
<p>Differences between UILabel and <a class="el" href="NIAttributedLabel.html" title="The NIAttributedLabel class provides support for displaying rich text with selectable links and embed...">NIAttributedLabel</a>:</p>
<ul>
<li><code>NSLineBreakByTruncatingHead</code> and <code>NSLineBreakByTruncatingMiddle</code> only apply to single lines and will not wrap the label regardless of the <code>numberOfLines</code> property. To wrap lines with any of these line break modes you must explicitly add newline characters to the string.</li>
<li>When you assign an NSString to the text property the attributed label will create an attributed string that inherits all of the label's current styles.</li>
<li>Text is aligned vertically to the top of the bounds by default rather than centered. You can change this behavior using <a class="el" href="NIAttributedLabel.html#verticalTextAlignment">verticalTextAlignment</a>.</li>
<li>CoreText fills the frame with glyphs until they no longer fit. This is an important difference from UILabel because it means that CoreText will not add any glyphs that won't fit in the frame, while UILabel does. This can result in empty NIAttributedLabels if your frame is too small where UILabel would draw clipped text. It is recommended that you use sizeToFit to get the correct dimensions of the attributed label before setting the frame.</li>
</ul>
<p><a class="el" href="NIAttributedLabel.html" title="The NIAttributedLabel class provides support for displaying rich text with selectable links and embed...">NIAttributedLabel</a> implements the UIAccessibilityContainer methods to expose each link as an accessibility item. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Tasks</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing the Text Attributes</div></td></tr>
<tr class="memitem:attributedString"><td class="memItemLeft" align="right" valign="top">NSAttributedString * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#attributedString">attributedString</a> <span class="suffix">property</span></td></tr>
<tr class="separator:attributedString"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing and Detecting Links</div></td></tr>
<tr class="memitem:autoDetectLinks"><td class="memItemLeft" align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#autoDetectLinks">autoDetectLinks</a> <span class="suffix">property</span></td></tr>
<tr class="separator:autoDetectLinks"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:dataDetectorTypes"><td class="memItemLeft" align="right" valign="top">NSTextCheckingType </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#dataDetectorTypes">dataDetectorTypes</a> <span class="suffix">property</span></td></tr>
<tr class="separator:dataDetectorTypes"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:deferLinkDetection"><td class="memItemLeft" align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#deferLinkDetection">deferLinkDetection</a> <span class="suffix">property</span></td></tr>
<tr class="separator:deferLinkDetection"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:addLink:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#addLink:range:">addLink:range:</a></td></tr>
<tr class="separator:addLink:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:removeAllExplicitLinks"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#removeAllExplicitLinks">removeAllExplicitLinks</a></td></tr>
<tr class="separator:removeAllExplicitLinks"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing Link Display Styles</div></td></tr>
<tr class="memitem:linkColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#linkColor">linkColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:linkColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:highlightedLinkBackgroundColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#highlightedLinkBackgroundColor">highlightedLinkBackgroundColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:highlightedLinkBackgroundColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:linksHaveUnderlines"><td class="memItemLeft" align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#linksHaveUnderlines">linksHaveUnderlines</a> <span class="suffix">property</span></td></tr>
<tr class="separator:linksHaveUnderlines"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:attributesForLinks"><td class="memItemLeft" align="right" valign="top">NSDictionary * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#attributesForLinks">attributesForLinks</a> <span class="suffix">property</span></td></tr>
<tr class="separator:attributesForLinks"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:attributesForHighlightedLink"><td class="memItemLeft" align="right" valign="top">NSDictionary * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#attributesForHighlightedLink">attributesForHighlightedLink</a> <span class="suffix">property</span></td></tr>
<tr class="separator:attributesForHighlightedLink"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Modifying Rich Text Styles for All Text</div></td></tr>
<tr class="memitem:lineHeight"><td class="memItemLeft" align="right" valign="top">CGFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#lineHeight">lineHeight</a> <span class="suffix">property</span></td></tr>
<tr class="separator:lineHeight"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:verticalTextAlignment"><td class="memItemLeft" align="right" valign="top">NIVerticalTextAlignment </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#verticalTextAlignment">verticalTextAlignment</a> <span class="suffix">property</span></td></tr>
<tr class="separator:verticalTextAlignment"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:underlineStyle"><td class="memItemLeft" align="right" valign="top">CTUnderlineStyle </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#underlineStyle">underlineStyle</a> <span class="suffix">property</span></td></tr>
<tr class="separator:underlineStyle"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:underlineStyleModifier"><td class="memItemLeft" align="right" valign="top">CTUnderlineStyleModifiers </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#underlineStyleModifier">underlineStyleModifier</a> <span class="suffix">property</span></td></tr>
<tr class="separator:underlineStyleModifier"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:shadowBlur"><td class="memItemLeft" align="right" valign="top">CGFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#shadowBlur">shadowBlur</a> <span class="suffix">property</span></td></tr>
<tr class="separator:shadowBlur"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:strokeWidth"><td class="memItemLeft" align="right" valign="top">CGFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#strokeWidth">strokeWidth</a> <span class="suffix">property</span></td></tr>
<tr class="separator:strokeWidth"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:strokeColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#strokeColor">strokeColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:strokeColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:textKern"><td class="memItemLeft" align="right" valign="top">CGFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#textKern">textKern</a> <span class="suffix">property</span></td></tr>
<tr class="separator:textKern"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Modifying Tail Truncation Properties</div></td></tr>
<tr class="memitem:tailTruncationString"><td class="memItemLeft" align="right" valign="top">NSString * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#tailTruncationString">tailTruncationString</a> <span class="suffix">property</span></td></tr>
<tr class="separator:tailTruncationString"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing the Delegate</div></td></tr>
<tr class="memitem:delegate"><td class="memItemLeft" align="right" valign="top">IBOutlet id<br class="typebreak"/>
< <a class="el" href="NIAttributedLabelDelegate-Protocol.html">NIAttributedLabelDelegate</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="NIAttributedLabel.html#delegate">delegate</a> <span class="suffix">property</span></td></tr>
<tr class="separator:delegate"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Modifying Rich Text Styles in Ranges</div></td></tr>
<tr class="memitem:setFont:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setFont:range:">setFont:range:</a></td></tr>
<tr class="separator:setFont:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:setStrokeColor:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setStrokeColor:range:">setStrokeColor:range:</a></td></tr>
<tr class="separator:setStrokeColor:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:setStrokeWidth:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setStrokeWidth:range:">setStrokeWidth:range:</a></td></tr>
<tr class="separator:setStrokeWidth:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:setTextColor:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setTextColor:range:">setTextColor:range:</a></td></tr>
<tr class="separator:setTextColor:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:setTextKern:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setTextKern:range:">setTextKern:range:</a></td></tr>
<tr class="separator:setTextKern:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:setUnderlineStyle:modifier:range:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#setUnderlineStyle:modifier:range:">setUnderlineStyle:modifier:range:</a></td></tr>
<tr class="separator:setUnderlineStyle:modifier:range:"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Adding Inline Images</div></td></tr>
<tr class="memitem:insertImage:atIndex:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#insertImage:atIndex:">insertImage:atIndex:</a></td></tr>
<tr class="separator:insertImage:atIndex:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:insertImage:atIndex:margins:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#insertImage:atIndex:margins:">insertImage:atIndex:margins:</a></td></tr>
<tr class="separator:insertImage:atIndex:margins:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:insertImage:atIndex:margins:verticalTextAlignment:"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#insertImage:atIndex:margins:verticalTextAlignment:">insertImage:atIndex:margins:verticalTextAlignment:</a></td></tr>
<tr class="separator:insertImage:atIndex:margins:verticalTextAlignment:"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessibility</div></td></tr>
<tr class="memitem:invalidateAccessibleElements"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="NIAttributedLabel.html#invalidateAccessibleElements">invalidateAccessibleElements</a></td></tr>
<tr class="separator:invalidateAccessibleElements"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Method Documentation</h2>
<a class="anchor" id="attributedString"></a>
<div class="memitem">
<h3 class="memname">attributedString</h3>
<div class="memdoc">
<p class="abstract">This method is now deprecated and will eventually be removed, please use attributedText instead. </p>
<div class="declaration">
@property (nonatomic, copy) NSAttributedString* attributedString;</td></tr>
</div>
</div>
</div>
<a class="anchor" id="autoDetectLinks"></a>
<div class="memitem">
<h3 class="memname">autoDetectLinks</h3>
<div class="memdoc">
<p class="abstract">A Booelan value indicating whether to automatically detect links in the string. </p>
<div class="declaration">
@property (nonatomic) BOOL autoDetectLinks;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is disabled.</p>
<p>Link detection is deferred until the label is displayed for the first time. If the text changes then all of the links will be cleared and re-detected when the label displays again.</p>
<p>Note that link detection is an expensive operation. If you are planning to use attributed labels in table views or similar high-performance situations then you should consider enabling defered link detection by setting <a class="el" href="NIAttributedLabel.html#deferLinkDetection">deferLinkDetection</a> to YES.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="NIAttributedLabel.html#dataDetectorTypes" title="The types of data that will be detected when autoDetectLinks is enabled. ">NIAttributedLabel::dataDetectorTypes</a> </dd>
<dd>
<a class="el" href="NIAttributedLabel.html#deferLinkDetection" title="A Boolean value indicating whether to defer link detection to a separate thread. ">NIAttributedLabel::deferLinkDetection</a> </dd></dl>
</div>
</div>
<a class="anchor" id="dataDetectorTypes"></a>
<div class="memitem">
<h3 class="memname">dataDetectorTypes</h3>
<div class="memdoc">
<p class="abstract">The types of data that will be detected when <a class="el" href="NIAttributedLabel.html#autoDetectLinks">autoDetectLinks</a> is enabled. </p>
<div class="declaration">
@property (nonatomic) NSTextCheckingType dataDetectorTypes;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is NSTextCheckingTypeLink. <a href="https://developer.apple.com/library/mac/#documentation/AppKit/Reference/NSTextCheckingResult_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40008798-CH1-DontLinkElementID_50">All available data detector types</a>. </p>
</div>
</div>
<a class="anchor" id="deferLinkDetection"></a>
<div class="memitem">
<h3 class="memname">deferLinkDetection</h3>
<div class="memdoc">
<p class="abstract">A Boolean value indicating whether to defer link detection to a separate thread. </p>
<div class="declaration">
@property (nonatomic) BOOL deferLinkDetection;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is disabled.</p>
<p>When defering is enabled, link detection will be performed on a separate thread. This will cause your label to appear without any links briefly before being redrawn with the detected links. This offloads the data detection to a separate thread so that your labels can be displayed faster. </p>
</div>
</div>
<a class="anchor" id="linkColor"></a>
<div class="memitem">
<h3 class="memname">linkColor</h3>
<div class="memdoc">
<p class="abstract">The text color of detected links. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* linkColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>The default color is [UIColor blueColor] on pre-iOS 7 devices or self.tintColor on iOS 7 devices. If linkColor is assigned nil then links will not be given any special color. Use attributesForLinks to specify alternative styling.</p>
<div class="image">
<img src="NIAttributedLabelLinkAttributes.png" alt="NIAttributedLabelLinkAttributes.png"/>
<div class="caption">
Link attributes</div></div>
</div>
</div>
<a class="anchor" id="highlightedLinkBackgroundColor"></a>
<div class="memitem">
<h3 class="memname">highlightedLinkBackgroundColor</h3>
<div class="memdoc">
<p class="abstract">The background color of the link's selection frame when the user is touching the link. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* highlightedLinkBackgroundColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>The default is [UIColor colorWithWhite:0.5 alpha:0.5].</p>
<p>If you do not want links to be highlighted when touched, set this to nil.</p>
<div class="image">
<img src="NIAttributedLabelLinkAttributes.png" alt="NIAttributedLabelLinkAttributes.png"/>
<div class="caption">
Link attributes</div></div>
</div>
</div>
<a class="anchor" id="linksHaveUnderlines"></a>
<div class="memitem">
<h3 class="memname">linksHaveUnderlines</h3>
<div class="memdoc">
<p class="abstract">A Boolean value indicating whether links should have underlines. </p>
<div class="declaration">
@property (nonatomic) BOOL linksHaveUnderlines;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is disabled.</p>
<p>This affects all links in the label. </p>
</div>
</div>
<a class="anchor" id="attributesForLinks"></a>
<div class="memitem">
<h3 class="memname">attributesForLinks</h3>
<div class="memdoc">
<p class="abstract">A dictionary of CoreText attributes to apply to links. </p>
<div class="declaration">
@property (nonatomic, copy) NSDictionary* attributesForLinks;</td></tr>
</div>
<h5>Discussion</h5>
<p>This dictionary must contain CoreText attributes. These attributes are applied after the color and underline styles have been applied to the link. </p>
</div>
</div>
<a class="anchor" id="attributesForHighlightedLink"></a>
<div class="memitem">
<h3 class="memname">attributesForHighlightedLink</h3>
<div class="memdoc">
<p class="abstract">A dictionary of CoreText attributes to apply to the highlighted link. </p>
<div class="declaration">
@property (nonatomic, copy) NSDictionary* attributesForHighlightedLink;</td></tr>
</div>
<h5>Discussion</h5>
<p>This dictionary must contain CoreText attributes. These attributes are applied after attributesForLinks have been applied to the highlighted link. </p>
</div>
</div>
<a class="anchor" id="lineHeight"></a>
<div class="memitem">
<h3 class="memname">lineHeight</h3>
<div class="memdoc">
<p class="abstract">Sets the line height for the text. </p>
<div class="declaration">
@property (nonatomic) CGFloat lineHeight;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is zero.</p>
<p>Setting this value to zero will make the label use the default line height for the text's font. </p>
</div>
</div>
<a class="anchor" id="verticalTextAlignment"></a>
<div class="memitem">
<h3 class="memname">verticalTextAlignment</h3>
<div class="memdoc">
<p class="abstract">The vertical alignment of the text within the label's bounds. </p>
<div class="declaration">
@property (nonatomic) NIVerticalTextAlignment verticalTextAlignment;</td></tr>
</div>
<h5>Discussion</h5>
<p>The default is <code>NIVerticalTextAlignmentTop</code>. This is for performance reasons because the other modes require more computation. Aligning to the top is generally what you want anyway.</p>
<p><code>NIVerticalTextAlignmentBottom</code> will align the text to the bottom of the bounds, while <code>NIVerticalTextAlignmentMiddle</code> will center the text vertically. </p>
</div>
</div>
<a class="anchor" id="underlineStyle"></a>
<div class="memitem">
<h3 class="memname">underlineStyle</h3>
<div class="memdoc">
<p class="abstract">The underline style for the entire label. </p>
<div class="declaration">
@property (nonatomic) CTUnderlineStyle underlineStyle;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is <code>kCTUnderlineStyleNone</code>.</p>
<p><a href="https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CoreText_StringAttributes_Ref/Reference/reference.html#//apple_ref/c/tdef/CTUnderlineStyle">View all available styles</a>. </p>
</div>
</div>
<a class="anchor" id="underlineStyleModifier"></a>
<div class="memitem">
<h3 class="memname">underlineStyleModifier</h3>
<div class="memdoc">
<p class="abstract">The underline style modifier for the entire label. </p>
<div class="declaration">
@property (nonatomic) CTUnderlineStyleModifiers underlineStyleModifier;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is <code>kCTUnderlinePatternSolid</code>.</p>
<p><a href="https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CoreText_StringAttributes_Ref/Reference/reference.html#//apple_ref/c/tdef/CTUnderlineStyleModifiers">View all available style modifiers</a>. </p>
</div>
</div>
<a class="anchor" id="shadowBlur"></a>
<div class="memitem">
<h3 class="memname">shadowBlur</h3>
<div class="memdoc">
<p class="abstract">A non-negative number specifying the amount of blur to apply to the label's text shadow. </p>
<div class="declaration">
@property (nonatomic) CGFloat shadowBlur;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is zero. </p>
</div>
</div>
<a class="anchor" id="strokeWidth"></a>
<div class="memitem">
<h3 class="memname">strokeWidth</h3>
<div class="memdoc">
<p class="abstract">Sets the stroke width for the text. </p>
<div class="declaration">
@property (nonatomic) CGFloat strokeWidth;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is zero.</p>
<p>Positive numbers will draw the stroke. Negative numbers will draw the stroke and fill. </p>
</div>
</div>
<a class="anchor" id="strokeColor"></a>
<div class="memitem">
<h3 class="memname">strokeColor</h3>
<div class="memdoc">
<p class="abstract">Sets the stroke color for the text. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* strokeColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is nil. </p>
</div>
</div>
<a class="anchor" id="textKern"></a>
<div class="memitem">
<h3 class="memname">textKern</h3>
<div class="memdoc">
<p class="abstract">Sets the kern for the text. </p>
<div class="declaration">
@property (nonatomic) CGFloat textKern;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is zero.</p>
<p>The text kern indicates how many points each character should be shifted from its default offset. A positive kern indicates a shift farther away. A negative kern indicates a shift closer. </p>
</div>
</div>
<a class="anchor" id="tailTruncationString"></a>
<div class="memitem">
<h3 class="memname">tailTruncationString</h3>
<div class="memdoc">
<p class="abstract">The string to display for tail truncation. </p>
<div class="declaration">
@property (nonatomic, copy) NSString* tailTruncationString;</td></tr>
</div>
<h5>Discussion</h5>
<p>By default this is nil and the default ellipses character, , is used. </p>
</div>
</div>
<a class="anchor" id="delegate"></a>
<div class="memitem">
<h3 class="memname">delegate</h3>
<div class="memdoc">
<p class="abstract">The delegate of the attributed-label object. </p>
<div class="declaration">
@property (nonatomic, weak) IBOutlet id<<a class="el" href="NIAttributedLabelDelegate-Protocol.html">NIAttributedLabelDelegate</a>> delegate;</td></tr>
</div>
<h5>Discussion</h5>
<p>The delegate must adopt the <a class="el" href="NIAttributedLabelDelegate-Protocol.html" title="The methods declared by the NIAttributedLabelDelegate protocol allow the adopting delegate to respond...">NIAttributedLabelDelegate</a> protocol. The <a class="el" href="NIAttributedLabel.html" title="The NIAttributedLabel class provides support for displaying rich text with selectable links and embed...">NIAttributedLabel</a> class, which does not strong the delegate, invokes each protocol method the delegate implements. </p>
</div>
</div>
<a class="anchor" id="addLink:range:"></a>
<div class="memitem">
<h3 class="memname">addLink:range:</h3>
<div class="memdoc">
<p class="abstract">Adds a link to a URL at a given range. </p>
<div class="declaration">
- (void)addLink:(NSURL *)urlLink range:(NSRange)range;</td></tr>
</div>
<h5>Discussion</h5>
<p>Adding any links will immediately enable user interaction on this label. Explicitly added links are removed whenever the text changes. </p>
</div>
</div>
<a class="anchor" id="removeAllExplicitLinks"></a>
<div class="memitem">
<h3 class="memname">removeAllExplicitLinks</h3>
<div class="memdoc">
<p class="abstract">Removes all explicit links from the label. </p>
<div class="declaration">
- (void)removeAllExplicitLinks;</td></tr>
</div>
<h5>Discussion</h5>
<p>If you wish to remove automatically-detected links, set autoDetectLinks to NO. </p>
</div>
</div>
<a class="anchor" id="setFont:range:"></a>
<div class="memitem">
<h3 class="memname">setFont:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the font for text in a given range. </p>
<div class="declaration">
- (void)setFont:(UIFont *)font range:(NSRange)range;</td></tr>
</div>
</div>
</div>
<a class="anchor" id="setStrokeColor:range:"></a>
<div class="memitem">
<h3 class="memname">setStrokeColor:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the stroke color for text in a given range. </p>
<div class="declaration">
- (void)setStrokeColor:(UIColor *)color range:(NSRange)range;</td></tr>
</div>
</div>
</div>
<a class="anchor" id="setStrokeWidth:range:"></a>
<div class="memitem">
<h3 class="memname">setStrokeWidth:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the stroke width for text in a given range. </p>
<div class="declaration">
- (void)setStrokeWidth:(CGFloat)width range:(NSRange)range;</td></tr>
</div>
<h5>Discussion</h5>
<p>Positive numbers will draw the stroke. Negative numbers will draw the stroke and fill. </p>
</div>
</div>
<a class="anchor" id="setTextColor:range:"></a>
<div class="memitem">
<h3 class="memname">setTextColor:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the text color for text in a given range. </p>
<div class="declaration">
- (void)setTextColor:(UIColor *)textColor range:(NSRange)range;</td></tr>
</div>
</div>
</div>
<a class="anchor" id="setTextKern:range:"></a>
<div class="memitem">
<h3 class="memname">setTextKern:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the kern for text in a given range. </p>
<div class="declaration">
- (void)setTextKern:(CGFloat)kern range:(NSRange)range;</td></tr>
</div>
<h5>Discussion</h5>
<p>The text kern indicates how many points each character should be shifted from its default offset. A positive kern indicates a shift farther away. A negative kern indicates a shift closer. </p>
</div>
</div>
<a class="anchor" id="setUnderlineStyle:modifier:range:"></a>
<div class="memitem">
<h3 class="memname">setUnderlineStyle:modifier:range:</h3>
<div class="memdoc">
<p class="abstract">Sets the underline style and modifier for text in a given range. </p>
<div class="declaration">
- (void)setUnderlineStyle:(CTUnderlineStyle)style modifier:(CTUnderlineStyleModifiers)modifier range:(NSRange)range;</td></tr>
</div>
<h5>Discussion</h5>
<p><a href="https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CoreText_StringAttributes_Ref/Reference/reference.html#//apple_ref/c/tdef/CTUnderlineStyle">View all available styles</a>.</p>
<p><a href="https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CoreText_StringAttributes_Ref/Reference/reference.html#//apple_ref/c/tdef/CTUnderlineStyleModifiers">View all available style modifiers</a>. </p>
</div>
</div>
<a class="anchor" id="insertImage:atIndex:"></a>
<div class="memitem">
<h3 class="memname">insertImage:atIndex:</h3>
<div class="memdoc">
<p class="abstract">Inserts the given image inline at the given index in the receiver's text. </p>
<div class="declaration">
- (void)insertImage:(UIImage *)image atIndex:(NSInteger)index;</td></tr>
</div>
<h5>Discussion</h5>
<p>The image will have no margins. The image's vertical text alignment will be NIVerticalTextAlignmentBottom.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">image</td><td>The image to add to the receiver. </td></tr>
<tr><td class="paramname">index</td><td>The index into the receiver's text at which to insert the image. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="insertImage:atIndex:margins:"></a>
<div class="memitem">
<h3 class="memname">insertImage:atIndex:margins:</h3>
<div class="memdoc">
<p class="abstract">Inserts the given image inline at the given index in the receiver's text. </p>
<div class="declaration">
- (void)insertImage:(UIImage *)image atIndex:(NSInteger)index margins:(UIEdgeInsets)margins;</td></tr>
</div>
<h5>Discussion</h5>
<p>The image's vertical text alignment will be NIVerticalTextAlignmentBottom.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">image</td><td>The image to add to the receiver. </td></tr>
<tr><td class="paramname">index</td><td>The index into the receiver's text at which to insert the image. </td></tr>
<tr><td class="paramname">margins</td><td>The space around the image on all sides in points. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="insertImage:atIndex:margins:verticalTextAlignment:"></a>
<div class="memitem">
<h3 class="memname">insertImage:atIndex:margins:verticalTextAlignment:</h3>
<div class="memdoc">
<p class="abstract">Inserts the given image inline at the given index in the receiver's text. </p>
<div class="declaration">
- (void)insertImage:(UIImage *)image atIndex:(NSInteger)index margins:(UIEdgeInsets)margins verticalTextAlignment:(NIVerticalTextAlignment)verticalTextAlignment;</td></tr>
</div>
<h5>Discussion</h5>
<dl class="section attention"><dt>Attention</dt><dd>Images do not currently support NIVerticalTextAlignmentTop and the receiver will fire multiple debug assertions if you attempt to use it.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">image</td><td>The image to add to the receiver. </td></tr>
<tr><td class="paramname">index</td><td>The index into the receiver's text at which to insert the image. </td></tr>
<tr><td class="paramname">margins</td><td>The space around the image on all sides in points. </td></tr>
<tr><td class="paramname">verticalTextAlignment</td><td>The position of the text relative to the image. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="invalidateAccessibleElements"></a>
<div class="memitem">
<h3 class="memname">invalidateAccessibleElements</h3>
<div class="memdoc">
<p class="abstract">Invalidates this label's accessible elements. </p>
<div class="declaration">
- (void)invalidateAccessibleElements;</td></tr>
</div>
<h5>Discussion</h5>
<p>When a label is contained within another view and that parent view moves, the label will not be informed of this change and any existing accessibility elements will still point to the old screen location. If this happens you must call -invalidateAccessibleElements in order to force the label to refresh its accessibile elements. </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<script type="text/javascript" src="widget.js"></script>
</body>
</html>