user6044645
user6044645

Reputation:

App Delegate - page controller error

I am unsure what I have done wrong with this statement below. I have added a page view controller to my project but when I build and run the project I get a 'bool' error. Here is the code:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.

    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()
}

Upvotes: 1

Views: 56

Answers (2)

Jordan
Jordan

Reputation: 424

You have not returned the statement, you either need to return true or false. I think you have forgot to return true. Try using the code below:

    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()

    return true

Hope that helps!

Upvotes: 0

Awesome.Apple
Awesome.Apple

Reputation: 1324

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.

    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()
    return true
}

Upvotes: 1

Related Questions