Skip to content

Instantly share code, notes, and snippets.

View lijithvipin's full-sized avatar

Lijith Vipin lijithvipin

View GitHub Profile
@hamdan
hamdan / MultipleTapLabel.swift
Last active November 15, 2023 21:26
Create Multiple Tappable Links in a UILabel
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)
@halgatewood
halgatewood / ServiceProvider.swift
Last active April 18, 2019 12:07
Completely Dynamic Apple TV Top Shelf using a Remote JSON file, Alamofire, Semaphore and SwiftyJSON
//
// ServiceProvider.swift
// BT Top Shelf
//
// Created by HalBook on 9/28/15.
// Copyright © 2015 HalGatewood.com. All rights reserved.
//
import Foundation
import TVServices