Ethan Brown
Ethan Brown

Reputation: 27292

My UIView isn't rendering

I'm new to iOS development, and I'm struggling to understand how the pieces fit together, and how to best use the Interface Builder (yes, I want to use IB and understand how it relates to changes in code).

Here's my current scenario:

In both the viewDidLoad method of both PageViewController and Page1ViewController, I have a println and both are displaying, so I know they are getting loaded...but when I run my app, I have a blank black screen.

Here's what I am trying to accomplish:

I'm comfortable with Swift, but the UIKit framework is a little daunting at the moment. Any guidance would be appreciated.

Upvotes: 2

Views: 110

Answers (1)

DairySeeker
DairySeeker

Reputation: 326

I know you've said you set the PageViewController as your initial view controller but are you sure you did this correctly. It should look similar to the screenshot below. Storyboard Showing Initial view controller

Ive just done a simple project with a page controller and then its in view did load did the following:-

let pagevc1 = UIViewController()
    pagevc1.view.backgroundColor = UIColor.redColor()

    self.setViewControllers([pagevc1], direction:     UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)

Which seems to display fine. How are you initialising the Page1ViewController view controller?

Upvotes: 1

Related Questions