Skip to content

Instantly share code, notes, and snippets.

View vegeth62's full-sized avatar

Vegeth62 vegeth62

View GitHub Profile
@taglia3
taglia3 / UIViewControllerExtension.swift
Last active August 21, 2018 19:04
This method allow you to go back the nearest ViewController of type T
import UIKit
extension UIViewController {
/// This method allow you to go back the nearest ViewController of type T
///
/// - Parameter type: the type of the target ViewController
/// - Returns: true if the method succeded, false if the user has to take extra actions to go back to the previous ViewController
func back<T: UIViewController>(to type: T.Type) -> Bool {