如何在第二级实现SplitViewController。 [英] How to implement SplitViewController on second level.?

查看:90
本文介绍了如何在第二级实现SplitViewController。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在二级实现SplitViewController。

How to implement SplitViewController on second level.

实际上我想要的是启动带有登录页面的应用程序并在登录后。我需要SplitViewController。

Actually what i want is to launch app with a login page and after login. I need SplitViewController.

推荐答案

对于相同的登录 - > splitview控制器,我正在执行以下操作:

For the same login -> splitview controller I'm doing the following:

a。子类 UIStoryboardSegue 并覆盖执行

@implementation SSPushSegue

- (void)perform
{
    UIWindow* window = [self.sourceViewController view].window;

    // Transition handling
    NSString *subtypeDirection = kCATransitionFromRight;
    switch ([UIApplication sharedApplication].statusBarOrientation)
    {
        case UIDeviceOrientationPortraitUpsideDown: subtypeDirection = kCATransitionFromLeft; break;
        case UIDeviceOrientationLandscapeLeft: subtypeDirection = kCATransitionFromTop; break;
        case UIDeviceOrientationLandscapeRight: subtypeDirection = kCATransitionFromBottom; break;
        default: break;
    }

    CATransition *animation = [CATransition animation];
    animation.duration = .5;
    animation.type = kCATransitionPush;
    animation.subtype = subtypeDirection;
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [window.layer addAnimation:animation forKey:NSStringFromClass([self class])];

    window.rootViewController = self.destinationViewController;
}

@end

b。将自定义Segue从初始视图控制器添加到目标,并将您的子类名称放在属性字段中。

b. Add "Custom Segue" from Initial View Controller to Destination and put your subclass name in the property field.

这篇关于如何在第二级实现SplitViewController。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆