Channel statistics improvements

This commit is contained in:
Ilya Laktyushin
2020-03-12 05:01:21 +04:00
parent d8b99880ea
commit f5dbf47b68
154 changed files with 6186 additions and 10908 deletions

View File

@@ -0,0 +1,37 @@
//
// UILabel+Utils.swift
// GraphTest
//
// Created by Andrei Salavei on 4/9/19.
// Copyright © 2019 Andrei Salavei. All rights reserved.
//
import UIKit
extension UILabel {
func setTextColor(_ color: UIColor, animated: Bool) {
if self.textColor != color {
if animated {
let animation = CATransition()
animation.timingFunction = CAMediaTimingFunction.init(name: .linear)
animation.type = .fade
animation.duration = .defaultDuration
self.layer.add(animation, forKey: "kCATransitionColorFade")
}
self.textColor = color
}
}
func setText(_ title: String?, animated: Bool) {
if self.text != title {
if animated {
let animation = CATransition()
animation.timingFunction = CAMediaTimingFunction.init(name: .linear)
animation.type = .fade
animation.duration = .defaultDuration
self.layer.add(animation, forKey: "kCATransitionTextFade")
}
self.text = title
}
}
}