Merged PR #35 and PR #44

This commit is contained in:
Xavier Schott 2018-06-01 15:26:00 -05:00
commit 193e19228f
2 changed files with 9 additions and 1 deletions

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.0.0</string>
<string>5.0.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>

View File

@ -78,6 +78,12 @@ public class TGPCamelLabels: TGPCamelLabels_INTERFACE_BUILDER {
}
}
@IBInspectable public var numberOfLinesInLabel:Int = 1 {
didSet {
layoutTrack()
}
}
// Label off-center to the left and right of the slider
// expressed in label width. 0: none, -1/2: half outside, 1/2; half inside
@IBInspectable public var offCenter:CGFloat = 0 {
@ -231,6 +237,7 @@ public class TGPCamelLabels: TGPCamelLabels_INTERFACE_BUILDER {
let centerY = bounds.height / 2.0
for name in names {
let upLabel = UILabel.init()
upLabel.numberOfLines = self.numberOfLinesInLabel
emphasizedLabels.append(upLabel)
upLabel.text = name
if let upFontName = upFontName {
@ -254,6 +261,7 @@ public class TGPCamelLabels: TGPCamelLabels_INTERFACE_BUILDER {
addSubview(upLabel)
let dnLabel = UILabel.init()
dnLabel.numberOfLines = self.numberOfLinesInLabel
regularLabels.append(dnLabel)
dnLabel.text = name
if let downFontName = downFontName {