Skip to content

voltbank/ReplaceRootViewController

Repository files navigation

ReplaceRootViewController

CI Status Version License Platform

Information

This project demonstrates a fix for http://www.openradar.me/21404408

This issue has been raised by multiple Stackoverflow support pages. This pod aims to make is super easy to replace the root view controller with animations.

You will need to use the console in xcode and debugging tools (eg "debug view hierarchy") to verify that everything is working as expected. UI test is also provided.

Attribution

This pod wouldnt be possible without the following...

Code...

if let window = view.window {
    window.set(rootViewController: yourReplacementViewController)
}

if you want you can also have a callback:..

if let window = view.window {
    window.set(rootViewController: yourReplacementViewController) { (completed) in
        print("Root view replaced!")
    }
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

ReplaceRootViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ReplaceRootViewController'

Author

sushant, sushant.verma@voltbank.com.au

License

ReplaceRootViewController is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors