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 trialDavid Lallone
6,020 PointsNetwork 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.
3 Answers
Andres Aguero
30,545 PointsHey 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
Cindy Lea
Courses Plus Student 6,497 PointsStackoverflow has some examples. Not sure if these are what youre looking for but its related to your error:
Luke Morgan-Scott
4,815 PointsHey 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!
Jhoan Arango
14,575 PointsJhoan Arango
14,575 PointsHello:
Are you able to share the code ? or a screenshot of your error ?