Cannot convert value of type 'UIBarButtonItem!' to expected argument type '_OptionalNilComparisonType'
<p>I'm trying to follow the FoodTracker tutorial on Apple Developer.  Right now I'm on the section "<a href="https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/Lesson8.html#//apple_ref/doc/uid/TP40015214-CH16-SW1" rel="nofollow">Implementing Navigation</a>".</p>

<p>It looks like this tutorial was written for a previous version of Swift as the code doesn't work sometimes without having to change overridden method signatures.</p>

<p>Here's an example:</p>

<pre><code>// This method lets you configure a view controller 
// before it's presented.
override func prepareForSegue(segue: UIStoryboardSegue, 
   sender: AnyObject?) {
</code></pre>

<p>On my version of Xcode (8.0) that method has to change to:</p>

<pre><code>override func prepare(for: UIStoryboardSegue, sender: Any?)
    {
</code></pre>

<p>...so that it matches the appropriate method in the parent class/protocol that needs to be overridden.</p>

<p>The tutorial continues with the following line of code:</p>

<pre><code>if saveButton == sender {
</code></pre>

<p>...which produces the error on the subject line.</p>

<p>I have spent the last few hours trying to fix this, searching online, trying to figure out why the optional sender Any? doesn't match a UIBarButtonItem but have been unsuccessful, so as a last resort I am posting here.  I have been attempting to follow a couple of books on iOS development, but I was running into problems with the code as well (doesn't work in the current version of Xcode(8.0)/Swift(3), so I decided to spend time on the official Apple tutorial.</p>

<p>Thanks in advance for any help you can provide.</p>