UIColor.sysFg -> UIColor.sysLabel

This commit is contained in:
relikd
2020-06-27 00:50:47 +02:00
parent 895cabee80
commit c7d0dc7c5f
8 changed files with 36 additions and 33 deletions

View File

@@ -1,14 +1,5 @@
import UIKit
extension NSMutableAttributedString {
func withColor(_ color: UIColor, fromBack: Int) -> Self {
let l = length - fromBack
let r = (l < 0) ? NSMakeRange(0, length) : NSMakeRange(l, fromBack)
self.addAttribute(.foregroundColor, value: color, range: r)
return self
}
}
extension String {
/// Check if string is equal to `domain` or ends with `.domain`
func isSubdomain(of domain: String) -> Bool { self == domain || self.hasSuffix("." + domain) }