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 Network Programming with Swift 2 Implementing a Forecast Client Activity Indicators

David Lallone
David Lallone
6,020 Points

Network Programming with Swift: Type 'ForecastAPIClient' does not conform to 'APIClient' Error

I cannot figure out why I am getting this error. As far as I know, I followed the tutorial exactly (of course, I must not have), but if anyone has any insight or help I would really appreciate it. Or even a working finished example file would be great.

Jhoan Arango
Jhoan Arango
14,575 Points

Hello:

Are you able to share the code ? or a screenshot of your error ?

3 Answers

Andres Aguero
Andres Aguero
30,545 Points

Hey David I had the same error. I found a quick solution by just removing the following code

init(config: NSURLSessionConfiguration)

from the APIClient protocol definition in APIClient.swift. That should fix the error

Luke Morgan-Scott
Luke Morgan-Scott
4,815 Points

Hey David! Try going back to the protocol for APIClient and making sure that the init function takes both a "config: NSURLSessionConfiguration" parameter as well as an "APIKey: String" parameter. We use these two parameters for the ForecastAPIClient during the lesson, but never when back to add the APIKey to APIClient.

Hope that helps!