This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UITapGestureRecognizer { | |
func didTapAttributedTextInLabel(label: UILabel, targetText: String) -> Bool { | |
guard let attributedString = label.attributedText, let lblText = label.text else { return false } | |
let targetRange = (lblText as NSString).range(of: targetText) | |
//IMPORTANT label correct font for NSTextStorage needed | |
let mutableAttribString = NSMutableAttributedString(attributedString: attributedString) | |
mutableAttribString.addAttributes( | |
[NSAttributedString.Key.font: label.font ?? UIFont.smallSystemFontSize], | |
range: NSRange(location: 0, length: attributedString.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ServiceProvider.swift | |
// BT Top Shelf | |
// | |
// Created by HalBook on 9/28/15. | |
// Copyright © 2015 HalGatewood.com. All rights reserved. | |
// | |
import Foundation | |
import TVServices |