Skip to content

Instantly share code, notes, and snippets.

View TucoBZ's full-sized avatar

Tulio Bazan da Silva TucoBZ

View GitHub Profile
@TucoBZ
TucoBZ / FadeView.swift
Created June 9, 2023 17:06 — forked from lpbas/FadeView.swift
Fade a UIView in iOS using Gradient (Swift Extension)
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
//
// http://sam.zoy.org/wtfpl/COPYING
//
// for more details.
//
@TucoBZ
TucoBZ / UIImageView+Nuke.swift
Created April 29, 2019 13:17
Get image from URL thread safe
//
// UIImageView+Nuke.swift
//
//
// Created by Aline e Tulio on 29/04/19.
// Copyright © 2019 . All rights reserved.
//
import UIKit
import Nuke
@TucoBZ
TucoBZ / stringRegexMatch.swift
Last active September 22, 2017 22:53
[Swift] - String Regex Match and Email Check
//: Playground - noun: a place where people can play
import Foundation
extension String {
/// Return all matches substrings from this string using this regex
///
/// - Parameter regex: A string Regex to match
/// - Returns: array of substrings that matches this regex
@TucoBZ
TucoBZ / minifyEmail.swift
Last active September 27, 2017 19:13
[Swift] - Minify Email
import Foundation
extension String {
/// Return a mimified email from this string, like glau***@gmail.com, the mimified length is half as the email length
var emailMinified : String? {
get {
var email = self
if let atIndex = email.components(separatedBy: "@").first?.endIndex {
let middleIndex = atIndex.encodedOffset/2