Skip to content

Instantly share code, notes, and snippets.

nahuelDeveloper / Extension+TableView.swift
Created April 14, 2022 17:19
Extension for easier registering and dequeueing of TableView cells
View Extension+TableView.swift
protocol ReusableView: AnyObject {
static var defaultReuseIdentifier: String { get }
extension ReusableView where Self: UIView {
static var defaultReuseIdentifier: String {
return String(describing: self)
nahuelDeveloper / regex.playground
Created April 4, 2022 21:24
Simple Regex Checker in Swift
View regex.playground
class RegexManager {
var regex: NSRegularExpression
init?(regexPattern: String) {
do {
regex = try NSRegularExpression(pattern: regexPattern)
} catch {
// Invalid pattern
return nil
nahuelDeveloper / .swift
Created October 31, 2017 21:18
AppDelegate example with logic to handle Remote Push Notifications from Firebase
View .swift
import UIKit
import UserNotifications
import Firebase
import FirebaseInstanceID
import FirebaseMessaging
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate {
var window: UIWindow?
nahuelDeveloper / CalculatorView.swift
Created October 4, 2017 12:49 — forked from natecook1000/CalculatorView.swift
An IBInspectable Calculator Construction Set
View CalculatorView.swift
// CalculatorView.swift
// as seen in
// (c) 2015 Nate Cook, licensed under the MIT license
import UIKit
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
nahuelDeveloper / TwitterShare.swift
Last active May 2, 2018 10:41
Share a gif on Twitter. Code adapted for Swift 3 and iOS 10
View TwitterShare.swift
// MARK: - Twitter
To upload a gif to Twitter, two different API calls are needed.
One to upload the gif. The other, to append a comment to the gif.
static func twitterShare(from viewController: FinishVideoViewController, path: String) {
let account = ACAccountStore()