0

I am trying to use ECSlidingViewController in my Iphone app (Using Storyboard).

I have 5 ViewControllers.
Login
MainSelection
FirstView
SecondView
MenuView

In the above controllers i have "Menu" Button on FirstView & SecondView on click of "Menu" button i want to slide the MenuView data and again on clicking on the button close the slide menu.

I went through samples from github ECSlidingViewController.I am referring the same code as shown in github examples.I am trying to integrate in my exisitng app.

Question: I tried to create InitialSlidingViewController subclass of ECSlidingViewController.But i cannot set this as InitalViewController in storyboard.Because my existing initialviewcontroller is "Login" view controller. Is there a way i can initialize SlidingViewController in "Main" view controller and by using slidingViewController.leftViewController open the slide menu when the menu button is tapped.

Here my main issue is i cannot set the InitialSlidingViewController subclass of ECSlidingViewController as InitialViewController.So what are the possible options to enable sliding for "Menu" button click on MainView.

Note: If i set the InitialSlidingViewController as InitialViewController in storyboard and providing respective topviewStoryboardID and leftViewStoryBoardID as runtime attributes it is working as expected.But this is not the way i am trying to integrate in my app.

Thanks in advance

4

1 回答 1

0

如果不查看示例代码,很难诊断出这样的问题。
我要说的是,过去曾与 ECSlidingViewController 合作过,您应该在 AppDelegate 中检查登录凭据。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    if (userHasCredentials) {
        [self loadNavigationControllerThatHasECSlidingViewController];  
    } else {  
        [self loadViewControllerThatHasLoginFlow];  
    }  
    return YES;
}  

这个想法是,通过将 LoginViewController 保留在 ECSlidingViewController 的导航控制器树之外,在成功完成登录流程之前,您不必展示该导航控制器。

于 2016-04-12T21:55:21.663 回答