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 Weather App with Swift Managing Complexity Callback Methods With Closures

Dominic Bryan
Dominic Bryan
14,452 Points

My compiler is not working, help with answer to make sure

Can someone just let me know what the answer is ( I don't want to retype mine out lol)

I am 99% sure I got what its asking for but my compiler or when I click preview its bringing up errors about things that are not even in my code?!

Im so confused so if anyone can post what there answer is so I can compare to make sure I am not going to mad then that would be awesome!

Callbacks.swift
import Foundation

// Add your code below
typealias BlogPostCompletion = (data: NSData!, response: NSURLResponse!, error: NSError! -> Void)
func fetchTreehouseBlogPosts(completion: BlogPostCompletion){}

1 Answer

Hello Dominic,

You got this!

Remove "data:", "response:", and "error:", and you should be gtg.

typealias BlogPostCompletion = ((NSData!, NSURLResponse!, NSError!) -> Void)

// Add your code below
func fetchTreehouseBlogPosts (completion: BlogPostCompletion) {
}
Dominic Bryan
Dominic Bryan
14,452 Points

OH DUH!

That's an embarrassing mistake, thanks for pointing it out

Dom

I made the same mistake lol : )