mamaral / MAPageViewController

MAPageViewController is a simple wrapper around the most common boiler-plate UIPageViewController setup.
MIT License
50 stars 9 forks source link

Black screen #2

Closed freefelt closed 8 years ago

freefelt commented 8 years ago

Objective C, iOS 9.2 Simulator. Just black screen and nothing else.

mamaral commented 8 years ago

In the demo project?

freefelt commented 8 years ago

Demo project does not compile swift file. I got MAPageViewController.h and MAPageViewController.m from it to my project, added:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    UIViewController *redVC = [UIViewController new];
    redVC.view.backgroundColor = [UIColor redColor];

    UIViewController *blueVC = [UIViewController new];
    blueVC.view.backgroundColor = [UIColor blueColor];

    UIViewController *greenVC = [UIViewController new];
    greenVC.view.backgroundColor = [UIColor greenColor];

    UIViewController *orangeVC = [UIViewController new];
    orangeVC.view.backgroundColor = [UIColor orangeColor];

    UIViewController *brownVC = [UIViewController new];
    brownVC.view.backgroundColor = [UIColor brownColor];

    UIViewController *yellowVC = [UIViewController new];
    yellowVC.view.backgroundColor = [UIColor yellowColor];

    NSArray *viewControllers = @[redVC, blueVC, greenVC, orangeVC, brownVC, yellowVC];

    MAPageViewController* pVC = [[MAPageViewController alloc] initWithViewControllers:viewControllers];

    self.window.rootViewController = pVC;

    return YES;
}

And it is only black screen on launch.

freefelt commented 8 years ago

I tried to get TestObjectiveCNavigationController and set it as class to storyboard initial navigation controller. Then it shows navigation bar and black screen too.

mamaral commented 8 years ago

This was written around the Swift 1 days. Been quite busy with my real job, and its been a while since I've done anything with Swift 2 so its not likely ill get to fixing the new swift compiler errors any time in the near future. Feel free to open a pull request if you're able to go through them.

freefelt commented 8 years ago

I need exactly Objective C edition of MAPageViewController. It is compiled, but shows black screen. Ok, I will try to see whats wrong.

freefelt commented 8 years ago

It was my fault. I forgot to add: self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; self.window.rootViewController = pVC; [self.window makeKeyAndVisible];