On page 79 it states to add:

var fahrenheitValue: Measurement?

below the definition for the celciusLabel outlet. When I add this line I get a ‘Use of undeclared type “Measurement” error’.

Was I supposed to include an extra class in ConversionViewController.swift? Any idea why this error is popping up?

Thanks for any help.

Hopefully an attached screenshot.

I thought it might have to do with incorrectly creating/adding the new ConversionViewController.swift file on page 75 but no luck. I deleted and restarted the project, starting again at Chapter 3 and when I got back to writing in the definition with Measurement? the same error popped up again.

Something else I notice is that if I create a new project and go to the ViewController.swift and delete the code within the brackets but add the following line:

var fahrenheitValue: Measurement?

it still produces an error of "Use of undeclared type ‘Measurement’.

This viewController.swift file has import UIKit and import Foundation. Any help or comment is appreciated.

I don’t have the book, but did you define the generic Measurement type yourself? If so, make sure that the file that contains its definition has been added to the project.

I don’t think I defined the generic Measurement type itself, I think it’s a part of the UIKit with Xcode 8.

With that being said, I hadn’t noticed that I was running Xcode 7. I kept thinking about what it could be that was giving me these issues and I noticed the Xcode version was not at 8. I didn’t realize that I had to go to the App store and re-download Xcode to get it to 8. Anyway, Xcode 8.3 has fixed my issues.

Thanks for the comment