Skip to content

Instantly share code, notes, and snippets.

View txaiwieser's full-sized avatar
💬
Helping you Find your stuff

Txai Wieser txaiwieser

💬
Helping you Find your stuff
View GitHub Profile
import UIKit
/// All ranges using NSString and NSRange
/// Is usually used together with NSAttributedString
extension NSString {
public func ranges(of searchString: String, options: CompareOptions = .literal, searchRange: NSRange? = nil) -> [NSRange] {
let searchRange = searchRange ?? NSRange(location: 0, length: self.length)
let subRange = range(of: searchString, options: options, range: searchRange)
if subRange.location != NSNotFound {
@txaiwieser
txaiwieser / UIFitLabel.swift
Last active August 27, 2015 21:59
UILabel subclass that resizes the font size to fit width AND height
//
// UIFitLabel.swift
//
//
// Created by Txai Wieser on 8/27/15.
// Copyright © 2015 Txai Wieser. All rights reserved.
//
import UIKit
@txaiwieser
txaiwieser / Delay.swift
Last active January 26, 2019 00:42
Delay.swift
//
// Delay.swift
//
//
// Created by Txai Wieser on 6/11/15.
// Copyright (c) 2015 TDW. All rights reserved.
//
import Foundation
//
// Array+SafeSubscript.swift
//
//
// Created by Txai Wieser on 29/06/15.
//
//
import Foundation
@txaiwieser
txaiwieser / UIBezierPath+Polygons.swift
Created May 11, 2015 19:20
UIBezierPath+Polygons.swift - UIBezierPath Swift extension for easy creation of polygon paths!
//
// UIBezierPath+Polygons.swift
//
//
// Created by Txai Wieser on 11/05/15.
// Copyright (c) 2015 TDW. All rights reserved.
// Based on: https://github.com/ZevEisenberg/ZEPolygon, thanks man!
import UIKit