O'Reilly logo

Core Data in Swift by Marcus S. Zarra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a Splash of Code

Wondering where the code is? As it stands, our recipe application is fully functional. We can run it without any actual code on our part and start inputting recipes immediately. The combination of Cocoa and Core Data makes it possible for us to produce this application with no custom code. However, we’re not stopping there.

Displaying a Picture of the Recipe

Since our iOS counterpart is capable of taking and displaying pictures, it seems only fair that the desktop variant should be able to add and display images. Fortunately, from the UI point of view, this functionality is an easy addition. Drag an NSImageView (aka Image Well) onto our window, and connect its Value Path setting to the imagePath of the recipe’s NSArrayController ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required