Skip to content

Instantly share code, notes, and snippets.

View rsaenzi's full-sized avatar
🏠
Working from home

Rigoberto Sáenz Imbacuán rsaenzi

🏠
Working from home
View GitHub Profile
@rsaenzi
rsaenzi / UIImageView+Async.swift
Last active October 15, 2019 15:47
Function lo load async an image using Kingfisher pod
//
// UIImageView+Async.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
import Kingfisher
@rsaenzi
rsaenzi / pod-update.sh
Created August 22, 2019 22:26
Script for Xcode projects, to update its dependencies via terminal on macOS
# Note: First run "chmod 755 pod-update.sh" to make it executable
# then you can run it using "sh pod-update.sh"
#!/bin/bash
clear
echo ""
echo "(1 / 5) >>>>> kill Xcode"
ps aux | grep /Applications/Xcode.app/Contents/MacOS/Xcode | awk '{ print $2 }' | xargs -L 1 kill -9
@rsaenzi
rsaenzi / UIView+Load.swift
Last active March 12, 2020 04:25
Util functions for UIViews
//
// UIView+Load.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
extension UIView {
@rsaenzi
rsaenzi / UILabel+Height.swift
Last active October 17, 2019 02:37
Gives an estimation of a UILabel's height for iOS apps
//
// UILabel+Height.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
extension UILabel {
@rsaenzi
rsaenzi / ApiCredentials.swift
Created July 21, 2019 21:55
Class that holds all the sensitive information required to connect to an authenticated API in iOS
//
// ApiCredentials.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UAObfuscatedString
// For security reasons, all sensitive info is obfuscated
@rsaenzi
rsaenzi / TitleView.swift
Created July 20, 2019 07:12
Code to display an image in a navigation bar item on iOS apps
//
// TitleView.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
class ScreenVC: UIViewController {
@rsaenzi
rsaenzi / Image.swift
Created July 20, 2019 07:09
Image enum to load UIImages in a clean way in iOS apps
//
// Image.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
enum Image: String {
@rsaenzi
rsaenzi / UITextField+Toolbar.swift
Last active August 29, 2020 11:05
Adds a toolbar over the keyboard on iOS
//
// UITextField+Toolbar.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
extension UITextField {
@rsaenzi
rsaenzi / CreditCardType.swift
Created July 12, 2019 22:37
Enum to handle credit card issuers for iOS
//
// CreditCardType.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
enum CreditCardType: String, Codable {
case visa = "VISA"
@rsaenzi
rsaenzi / String+Extensions.swift
Last active July 12, 2019 22:38
String extensions for String class in Swift
//
// String+Extensions.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import Foundation
extension String {