Nice tutorial, thanks. I’m really hoping there a followup imminently coming which will show how to incorporate NSUndoManager into bindings, and especially how to tie Core Data into this.
Great tutorial! I did find a minor error under “Binding Text Fields to Their Properties”. Where you write “The Controller Key should be objectValue.trackName.” I think Controller Key should be Model Key Path. That tripped me up for a bit.
May I ask a question that why there’s self.willChangeValueForKey and self.didChangeValueForKey for screenShots but no such pieces of code for artworkImage?
In general, you should use will/didChangeValueForKey if you are going to affect a value in-directly, for example if you have a Class Student and it has firstName, lastName and fullName where fullName is getting and setting in firstName and lastName, then on changing firstName or lastName you should call will/didChangeValueForKey fullName
To get this working with Xcode 8 and Swift 3, I made the following changes after accepting defaults of the automatic conversion process and applying the suggested project changes etc.
iTunesResults.swift
Line 36, changed to
dynamic var artworkURL : URL!
iTunesRequestManager.swift
Line 39, changed to
let itunesData : [String : Any] = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! [String : Any]