Skip to content

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dokgi88 committed Jul 16, 2019
2 parents 10b67ff + ddd298d commit 61918ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
16 changes: 2 additions & 14 deletions Example/FlashingLabel/ViewController.swift
Expand Up @@ -17,28 +17,16 @@ class ViewController: UIViewController {
view.backgroundColor = .white
return view
}()
private let blackView: FlashingContainerView = {
let view = FlashingContainerView()
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .black
return view
}()

override func viewDidLoad() {
super.viewDidLoad()

view.addSubview(whiteView)
view.addSubview(blackView)

whiteView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
whiteView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
whiteView.trailingAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
whiteView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
whiteView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true

blackView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
blackView.leadingAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
blackView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
blackView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
}

override func didReceiveMemoryWarning() {
Expand Down Expand Up @@ -100,7 +88,7 @@ class FlashingContainerView: UIView {
label.baseColor = UIColor.black.withAlphaComponent(0.1)
label.flashingColors = [.pantone_roseQuartz(), .pantone_serenity(), .pantone_greenery(), .pantone_ultraViolet(), .pantone_livingCoral(), .pantone_roseQuartz()]
label.flashingTime = 0.17
label.text = "HELLO"
label.text = "HELLO FLASHING LABEL"
label.font = .boldSystemFont(ofSize: 20)
label.startFlashing()
return label
Expand Down
2 changes: 1 addition & 1 deletion FlashingLabel.podspec
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'FlashingLabel'
s.version = '1.0.2'
s.version = '1.0.3'
s.summary = 'very easy and simple flashing label'

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 1 addition & 1 deletion FlashingLabel/Classes/FlashingLabel.swift
Expand Up @@ -51,7 +51,7 @@ public class FlashingLabel: UILabel {
let attribute = NSMutableAttributedString(string: text)
for i in 0..<sliceColors.count {
let increCount = flashingCount+i
let count = (Array(text).count <= increCount) ? increCount-sliceColors.count:increCount
let count = (Array(text).count <= increCount) ? increCount-Array(text).count:increCount
let color = sliceColors[i]
let range = NSMakeRange(count, 1)
attribute.addAttribute(NSAttributedString.Key.foregroundColor, value: color, range: range)
Expand Down

0 comments on commit 61918ab

Please sign in to comment.