Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Improving Our User Interface Adding a Pop of Color

Jeff Lyons
Jeff Lyons
7,243 Points

AppDelegate file differences

I cannot get the auto-complete to function when I start typing...

application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false) 

...as Pasan does in the video. After closer inspection, I realized that my AppDelegate file is a bit different and wondered if I should be entering something else.

For that method declaration, the video shows this:

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool

But mine has this:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool

Clearly something has been updated since this video was created. When I type the line as it appears in the video, the app does work, but I can't help but feel a bit dirty by forcing it. Clearly it wants something else, I'm just not sure what.

Joseph Kandi
Joseph Kandi
2,640 Points

Mine looks like yours, Pasan should have been using an older version of XCode but my auto-complete works fine, i didnt have to change anything i just added the line and it worked.

1 Answer

Jeff Lyons
Jeff Lyons
7,243 Points

Thanks, Joseph. I didn't have to change anything either. It worked, but all I saw when I started typing "application." was <<error>> in the auto-complete window that popped up. I continued typing the line and ran the app without errors. Not sure why mine wasn't behaving. I haven't had problems with any other part of the Swift projects so far. Just that one.

Jeff Lyons
Jeff Lyons
7,243 Points

For anyone viewing this, I just reopened my Fun Facts app and tried this again. No issues this time. I have no idea what the problem was the first time I did this. It's the same version of Xcode and the original file. Just a temp glitch, I guess.