Skip to content

Instantly share code, notes, and snippets.

View taglia3's full-sized avatar

Matteo Tagliafico taglia3

  • Reply
  • Turin
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 {
@taglia3
taglia3 / StronglyTypedCell.swift
Created December 29, 2017 09:26 — forked from malcommac/StronglyTypedCell.swift
Strongly Typed UITableViewCell allocation in Swift
import Foundation
import UIKit
/// MARK: - This protocol is used to allows cell to be dequeued with strong type
public protocol DequeuableProtocol: class {
/// Return the nib name in which the dequeuable resource is located
/// You must implement it if your cell is located in a separate xib file
/// (not for storyboard).
/// In this case you should call `table.register(CellClass.self)` before