Skip to content

Instantly share code, notes, and snippets.

View CassiusPacheco's full-sized avatar

Cassius Pacheco CassiusPacheco

View GitHub Profile
@CassiusPacheco
CassiusPacheco / UIViewController.swift
Created December 14, 2017 03:25
View Resizer when Keyboard Appears
// MARK: - View Resizer when Keyboard Appears
extension UIViewController {
// This implementation was taken from: https://newfivefour.com/swift-ios-xcode-resizing-on-keyboard.html
// to improve the user experience the view updates will happen with the same animation as the keyboard's
func setupViewResizerOnKeyboardShown() {
NotificationCenter.default.addObserver(self,
enum NetworkFailureCode: Int {
case unknown = -1
case cancelled = -999
case badURL = -1000
case timedOut = -1001
case unsupportedURL = -1002
case cannotFindHost = -1003
case cannotConnectToHost = -1004