Review sources. Learn how to change the code in the prototype to a class and store it in the sources. The author also explains the scope of source folders.
- [Instructor] The playground now…has a working class menu board.…There's another feature of playground…that will make prototyping easier, the sources folder.…Go back to Xcode.…Close the assisted editor.…Open the navigator.…You see the two sub-folders of the playground.…We discussed resources already…and the pizza image is still there.…The second one is sources.…Select that one.…Sources is where you put code to be compiled…before your playground runs.…
You use this for classes you already have working…and want to build from.…In the menu board project,…we can move the menu board class to the sources.…This compiles the code…before running the code on the playground,…making the end result faster than in the playground page.…It also loses much of the debugging features,…so make sure your code works…before placing it in a source file.…With sources selected, select file, new, file…from the drop down menu.…
A new file appears.…Change the file name to MenuBoard.swift.…You'll notice the code window imports foundation…instead of UIKit.…
- Comparing iPad and Xcode playgrounds
- Creating and testing Swift classes and code in iPad and Xcode playgrounds
- Prototyping code
- Debugging and testing with Quick Look live views
- Using markup to interactively document code and create educational lessons
- Compiling code into playground books
Skill Level Intermediate
iOS App Development: Notificationswith Steven Lipton1h 10m Intermediate
1. Introducing Playgrounds
2. Xcode Playgrounds
3. iPad Playgrounds
4. Markup and Playgrounds
5. Playground Books
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.