Skip to content

Instantly share code, notes, and snippets.

@pietrorea
Created November 12, 2015 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietrorea/08e88961185bb95b4633 to your computer and use it in GitHub Desktop.
Save pietrorea/08e88961185bb95b4633 to your computer and use it in GitHub Desktop.
UIViewController+Containment.swift
import UIKit
extension UIViewController {
func addChildVC(viewController: UIViewController) {
addChildViewController(viewController)
view.addSubview(viewController.view)
viewController.didMoveToParentViewController(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment