Created
November 12, 2015 18:56
-
-
Save pietrorea/08e88961185bb95b4633 to your computer and use it in GitHub Desktop.
UIViewController+Containment.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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