import Foundation
import UIKit
//
// UILabel.h
// UIKit
//
// Copyright (c) 2006-2014 Apple Inc. All rights reserved.
//
class UILabel : UIView, NSCoding {
var text: String! // default is nil
var font: UIFont! // default is nil (system font 17 plain)
var textColor: UIColor! // default is nil (text draws black)
var shadowColor: UIColor! // default is nil (no shadow)
var shadowOffset: CGSize // default is CGSizeMake(0, -1) -- a top shadow
var textAlignment: NSTextAlignment // default is NSTextAlignmentLeft
var lineBreakMode: NSLineBreakMode // default is NSLineBreakByTruncatingTail. used for single and multiple lines of text
// the underlying attributed string drawn by the label, if set, the label ignores the properties above.
var attributedText: NSAttributedString! // default is nil
// the 'highlight' property is used by subclasses for such things as pressed states. it's useful to make it part of the base class as a user property
var highlightedTextColor: UIColor! // default is nil
var highlighted: Bool // default is NO
var userInteractionEnabled: Bool // default is NO
var enabled: Bool // default is YES. changes how the label is drawn
// this determines the number of lines to draw and what to do when sizeToFit is called. default value is 1 (single line). A value of 0 means no limit
// if the height of the text reaches the # of lines or the height of the view is less than the # of lines allowed, the text will be
// truncated using the line break mode.
var numberOfLines: Int
// these next 3 property allow the label to be autosized to fit a certain width by scaling the font size(s) by a scaling factor >= the minimum scaling factor
// and to specify how the text baseline moves when it needs to shrink the font.
var adjustsFontSizeToFitWidth: Bool // default is NO
var adjustsLetterSpacingToFitWidth: Bool // deprecated - hand tune by using NSKernAttributeName to affect tracking
var minimumFontSize: CGFloat // NOTE: deprecated - use minimumScaleFactor. default is 0.0
var baselineAdjustment: UIBaselineAdjustment // default is UIBaselineAdjustmentAlignBaselines
var minimumScaleFactor: CGFloat // default is 0.0
// override points. can adjust rect before calling super.
// label has default content mode of UIViewContentModeRedraw
func textRectForBounds(bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect
func drawTextInRect(rect: CGRect)
// Support for constraint-based layout (auto layout)
// If nonzero, this is used when determining -intrinsicContentSize for multiline labels
var preferredMaxLayoutWidth: CGFloat
}
1. shadowColor shadowOffset
shadowColor :阴影颜色
shadowOffset :阴影偏移量 CGSize类型,默认CGSizeMake(0, -1),左右不偏移,向上偏移一个单位。
CGSizeMake(x,y) x为正向右偏移,为负向左偏移;y为正向下偏移,为负向上偏移。
下图为CGSizeMake(2,5)的效果图: