diff --git a/TGPControls/Info.plist b/TGPControls/Info.plist index d69dcdf..ca45105 100644 --- a/TGPControls/Info.plist +++ b/TGPControls/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.0.0 + 5.0.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/TGPControls/TGPCamelLabels.swift b/TGPControls/TGPCamelLabels.swift index 7f0163f..08cea98 100644 --- a/TGPControls/TGPCamelLabels.swift +++ b/TGPControls/TGPCamelLabels.swift @@ -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 {