Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTTextLayer.h
Go to the documentation of this file.
1 #import "CPTBorderedLayer.h"
2 #import "CPTTextStyle.h"
3 
5 
7 
9 
10 @property (readwrite, copy, nonatomic, nullable) NSString *text;
11 @property (readwrite, strong, nonatomic, nullable) CPTTextStyle *textStyle;
12 @property (readwrite, copy, nonatomic, nullable) NSAttributedString *attributedText;
13 @property (readwrite, nonatomic) CGSize maximumSize;
14 
17 -(nonnull instancetype)initWithText:(nullable NSString *)newText;
18 -(nonnull instancetype)initWithText:(nullable NSString *)newText style:(nullable CPTTextStyle *)newStyle NS_DESIGNATED_INITIALIZER;
19 -(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)newText;
20 
21 -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER;
22 -(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER;
24 
28 -(void)sizeToFit;
30 
31 @end
CPTBorderedLayer.h
CPTTextStyle.h
CPTTextStyle
Immutable wrapper for various text style properties.
Definition: CPTTextStyle.h:18
-[NSObject copy]
id copy
-[CPTTextLayer sizeToFit]
void sizeToFit()
Resizes the layer to fit its contents leaving a narrow margin on all four sides.
Definition: CPTTextLayer.m:340
NSAttributedString
-[CPTTextLayer sizeThatFits]
CGSize sizeThatFits()
Determine the minimum size needed to fit the text.
Definition: CPTTextLayer.m:312
CGFloat
typedef CGFloat
CGSize
typedef CGSize
CPTBorderedLayer
A layer with a border line and background fill.
Definition: CPTBorderedLayer.h:7
CPTTextLayer::maximumSize
CGSize maximumSize
The maximum size of the layer. The default is {0.0, 0.0}.
Definition: CPTTextLayer.h:13
CPTTextLayer::textStyle
CPTTextStyle * textStyle
The text style used to draw the text.
Definition: CPTTextLayer.h:11
-[CALayer initWithLayer]
id initWithLayer
CPTTextLayer
A Core Animation layer that displays text drawn in a uniform style.
Definition: CPTTextLayer.h:9
kCPTTextLayerMarginWidth
const CGFloat kCPTTextLayerMarginWidth
Margin width around the text.
Definition: CPTTextLayer.m:9
NSString
CPTTextLayer::text
NSString * text
The text to display.
Definition: CPTTextLayer.h:10
CPTTextLayer::attributedText
NSAttributedString * attributedText
The styled text to display.
Definition: CPTTextLayer.h:12
NSCoder