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 / NSLayoutConstraint+Multiplier.swift
Last active June 19, 2020 16:51
To create a copy of a constraint, with a different multiplier
//
// NSLayoutConstraint+Multiplier.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
extension NSLayoutConstraint {
@discardableResult
@rsaenzi
rsaenzi / UITableView+Load.swift
Last active November 23, 2020 15:18
To load a UITableViewCell or UICollectionViewCell by the class name, avoiding ! operator and using a string literal for the name of the cell identifier Raw
//
// UITableView+Load.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
extension UITableView {
@rsaenzi
rsaenzi / UIViewController+Load.swift
Last active October 19, 2021 13:05
To load a UIViewController by the class name, avoiding ! operator and using a string literal for the name of the viewController identifier
//
// UIViewController+Load.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import UIKit
extension UIViewController {
@rsaenzi
rsaenzi / UIView+Border.swift
Last active October 4, 2017 01:49
To add inspectable properties to control the border of a view
//
// UIView+Border.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
import UIKit
@IBDesignable
@rsaenzi
rsaenzi / CustomView.swift
Last active August 29, 2020 11:04
Template for custom view loaded from a .xib file
//
// CustomView.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
// Notes:
// - Bind content to the ContentView in Interface Builder
// - Make the xib's file owner be this class
@rsaenzi
rsaenzi / PieGraph.swift
Created October 3, 2017 15:52
Custom view to show a simple pie chart
//
// PieGraph.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
import UIKit
@IBDesignable
@rsaenzi
rsaenzi / Language.swift
Last active July 20, 2019 22:28
To manage strings localization using the default localization system: Localizable.strings
//
// Language.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
// Dependencies:
// - Language+UIKit: https://gist.github.com/rsaenzi/a575e66f5e617559767e5b523bad2161
@rsaenzi
rsaenzi / Project.command
Last active June 12, 2019 20:09
Bash file for MacOS to keep the iOS project Groups synced to Folders, and pods updated
#
# Project.command
#
# Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
# Copyright © 2017. All rights reserved.
#
echo " "
echo "Go to Project"
cd "/Files/Projects/iOS/ProjectFolder"
@rsaenzi
rsaenzi / BuildConfiguration.swift
Last active August 22, 2018 21:51
To access default Xcode Build Configurations from code
//
// BuildConfiguration.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017 Rigoberto Sáenz Imbacuán. All rights reserved.
//
// For this to work, please add on "Other Swift Flags" the following keys:
// Key -D BUILD_CONFIG_DEBUG for Debug
// Key -D BUILD_CONFIG_RELEASE for Release
@rsaenzi
rsaenzi / Info.plist
Created October 11, 2017 00:24
To disable App Transport Security
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>