Workspaces, and even outside projects for that matter, can share code files. In sharing, you have the option to copy the file(s) or to link them. In this video, learn how the entire process works.
- [Instructor] Let's say you want to share a file…between projects and when you edit the file…in one project, it's updated in another project.…Now, we're going to look at this…from the perspective of working in a Workspace…because it's easy to demonstrate in that way…but this same technique will work whether or not…you're using a Workspace,…so you can share a file between multiple projects…using this method.…So, make sure that you're actually opening up…the Workspace and not an Xcode project for this.…
So, I'm double clicking on my Workspace file…and there I have my two projects in there.…I'll now select ViewController.swift…and then press Command + N in Project2…to create a new Cocoa Class.…We'll just call this SharingExample…and then hit Return or Next to advance through the menus.…So, there's my class…and I'm actually not even going to create…any properties for it,…I'm actually just going to use it…and create an instance of the class…inside of the other project.…
So, if I go to my other project right now…and I go inside viewDidLoad…
- Installing Xcode
- Creating your first project
- Editing code
- Creating snippets
- Prototyping in playgrounds
- Implementing version control with Git
- Building and connecting the interface
- Compiling and debugging apps in Xcode
- Creating workspaces for sharing resources and code
Skill Level Beginner
1. Getting Started
2. Edit Code
3. Source Control
4. Interface Builder Basics
5. Compile and Debug
Create a workspace2m 51s
Next steps1m 5s
- 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.