I am curious to know if i can develop an app having 2 view controllers .I have gone through some links ,but couldn't find a solution if I'm using storyboard.If i already have a rooviewcontroller,how can i remove it and add another view as rootviewcontroller?Any thoughts?
How can you add 2 rootviewcontrollers in IOS App using storyboard
366 Views Asked by Suraj K Thomas At
2
There are 2 best solutions below
0
Toseef Khilji
On
At a time there is only one rootviewController in app,
you can replace directly using following,
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
YourVC *rootViewController = [storyboard instantiateViewControllerWithIdentifier:@"YourVC"];
self.window.rootViewController = rootViewController;
in appDelegate Method,
Related Questions in OBJECTIVE-C
- How do I customize NSOutlineView to have border color?
- UIWebView Screen Fitting Issue
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Image and Text locations in UIButton
- setting OpenGL version in objective-C
- Setup code for xibs in iOS. -awakFromNb:
- realm db, get parent link of object
- CFBundleDocumentType is not working in myproject-Info.plist file
- UIPopoverPresentationController not rendering properly
- Using Storyboard Reference
- Pass Data between two view controllers using 'Delegation' : Objective-C
- Unexpected CALayer Vertical Flipping on 3D Rotation 'Bounce'
- Setting View orientation to portrait is ignored
- UITextField append / between dates while enforcing character limit
Related Questions in UIVIEWCONTROLLER
- Different storyboard's entry points depending on a parameter
- Labels properties changing in Xcode
- How can I modally present a UIViewController on another Storyboard that's embedded in a UINavigationController?
- iOS - Logout functionality
- How can I prevent the keyboard from covering up subviews on a UIViewController?
- Load a UIViewController with data from .plist
- Presenting a View Controller with a button in a UITableViewCell programmatically (Swift)
- why isnt my second view loading after transition?
- Implementing delegate methods in separate class
- Subclass as delegate of superclass
- Change UIWindow backgroundColor from UIViewController?
- IOS: Transition with modal ViewContorller
- viewControllers that doesn't appear
- passing data, still nil in the other ViewController
- calling parents viewcontroller method when dismissing child viewcontroller
Related Questions in IOS7
- Animation issue on iOS 7 but not on iOS 8
- iPad2 is stay portrait for a second before move to landscape
- an app supporting arm64 and armv7 running on arm64 and ios 7 ipad air
- How to add directions among two custom locations in Mapview for IOS 7 (objective c)
- Parse.com crash with basic project on iOS 7.0
- Compress Or Reduce the size of sqlite database file in ios
- how can I create a URL/site to send a HTTP 204 or HTTP 403 response?
- this class is not key value coding-compliant for the key itemname
- prepare push segue from presentviewcontroller using xib ios7
- iOS 7 - Proper stop of stop and 'clear' dispatch_queue_t
- Are there any way to make a separator view like UITableView's separator?
- Autolayout works great on iOS 8, crashes on iOS 7
- UINavigationBar Disappear - Only on iOS7
- GPUImage - low FPS
- Check UITextfield have only Alphabet not numeric value
Related Questions in XCODE5
- When will Apple start rejecting apps built with Xcode 5.x?
- How to close a container view
- Got an error while parsing json
- Hide iAd view on pressing a button
- Can't see UIView after added to UIViewController in storyboard separately in xcode 5.1
- View controller won't return to previous view controller programmatically
- How to clean iOS Device Console from command line?
- Thread 1: signal SIGABRT on button clicked
- Compile time Error libxml2.dylib
- phonegap admob plugin get banner height in xcode
- Xcode app validation "You must supply an Apple ID"
- XCode Archive: "you must supply an apple ID"
- How to re-trigger a process repeatedly in background in xcode
- Backward compatibility for iOS build SDKs
- NSArrayM replaceObjectAtIndex:withObject: object cannot be nil'
Related Questions in ROOTVIEW
- Add UINavigationController to navigation stack
- How to call view from DatePickerFragment
- Swap rootViewController with animation?
- Setting TabBarViewController as Root View in AppDelegate on launch
- remove all uiviewcontroller from hierarchy to display the first uiviewcontroller
- How do you stop the UIWindow from clipping to bounds on rotation and showing the 'black frame'?
- reinitialize root view in iOS
- pushViewController and popToRootViewController
- How to fade up initial root view controller to reveal new background root view controller
- Is there a way to load swiftUI view into NSView?
- how do i find the root view in my android studio project?
- android.view.ViewRootImpl cannot be cast to android.view.View
- iOS switch rootViewController not working
- RootviewController and viewControllers rotation
- How can you add 2 rootviewcontrollers in IOS App using storyboard
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can do so. You just have to add the code below to the place/action where you want to change the rootViewController.
And make setting of AnotherRootViewController to Storyboard as shown in figure:
Let me know if it satisfy your requirement.