Skip to content

Commit

Permalink
making stuff public
Browse files Browse the repository at this point in the history
  • Loading branch information
GPryan committed Aug 7, 2019
1 parent 237530a commit c455fc5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/SkeletonLabel/SkeletonLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@

import UIKit

@IBDesignable class SkeletonLabel: UILabel {
@IBDesignable public class SkeletonLabel: UILabel {
var skeletonColor: UIColor?

@IBInspectable var color: UIColor? {
get { return self.skeletonColor }
set {
self.skeletonColor = newValue
self.backgroundColor = newValue
}
}

override var text: String? {
didSet {
guard let string = self.text, !string.isEmpty else { return }
self.unskeletonize()
}
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.skeletonize()
}

public func skeletonize() {
self.text = " " // :) needs to be a space so view takes a height without setting one explicitly
self.backgroundColor = self.skeletonColor
}

private func unskeletonize() {
self.backgroundColor = UIColor.clear
}
Expand Down

0 comments on commit c455fc5

Please sign in to comment.