Group Group Group Group Group Group Group Group Group

Chapter 34 - does not conform to expected type 'Decoder'

iOS Apprentice Early Access v8.0.0

I’m getting: Argument type ‘CLPlacemark’ does not conform to expected type ‘Decoder’

in the updateLabels function, this code fragment:
if let placemark = placemark {
addressLabel.text = String(from: placemark)
(error is on second line)

When I search for this error, it seems to tell me that I need to make a struct ‘Decodable’, but we are not using a struct here.

@steveb_la Do you still have issues with this?

I’m working thru the iOS TDD course and will get back to this soon.Thank you.

Hi all,
in case you are interessted in the solution:
The “String” in the code should not be spelled with a capital “S” but with a small one.


@danking Thank you for sharing your solution - much appreciated!

I finally got to Chapter 20 of iOS Apprentice 8.3.0 and on page 603, the code is still showing:
addressLabel.text = String(from: placemark)
instead of
addressLabel.text = string(from: placemark)

Thanks to @danking for pointing this out originally.