Skip to content

Instantly share code, notes, and snippets.

View RodrigoLGuimaraes's full-sized avatar

Rodrigo Longhi Guimarães RodrigoLGuimaraes

View GitHub Profile
@RodrigoLGuimaraes
RodrigoLGuimaraes / TeaCode.swift
Last active August 4, 2020 21:12
TeaCode autocompletion in swift
#if DEBUG
class TeaCode {
/// Do not use quotes to fill the string. Also, press CMD+OPTION+E to expand.
static func codableView(named: String) {}
/// Do not use quotes to fill the string. Also, press CMD+OPTION+E to expand.
static func codableViewTest(viewNamed: String) {}
}
#endif
@RodrigoLGuimaraes
RodrigoLGuimaraes / AlamofireSessionManagerBuilder.swift
Last active February 1, 2022 08:07
Creation of a Moya provider with SSL pinning
// 1 - provider creation
let provider = MoyaProvider<MyRouter>(
manager: AlamofireSessionManagerBuilder().build()
)
// 2 - session manager builder
class AlamofireSessionManagerBuilder {
var policies: [String: ServerTrustPolicy]?
var configuration = URLSessionConfiguration.default
@RodrigoLGuimaraes
RodrigoLGuimaraes / Device.swift
Last active November 20, 2018 17:47
Simplify your iOS device identification with this small helper swift file. Works on XCode9 with Swift 4. This class was originally created by Kevin Xu (https://gist.github.com/imkevinxu/2bb1197552b095ab25c8). -- FOR IT TO WORK YOU HAVE TO FIRST INSTALL GBDeviceInfo (https://github.com/lmirosevic/GBDeviceInfo).
//
// Device.swift
//
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15.
// Updated by Rodrigo L G on 2/23/18.
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved.
//
import Foundation
import UIKit
//: Playground - noun: a place where people can play
import UIKit
enum Animation : String {
case Idle = "Idle"
case Happy = "Happy"
case Sad = "Sad"
case Quiet = "Quiet"
}