CodeBase is an environment for Xcode that allows you to gather together your coding notes with live working examples.
- It acts as a single source of truth for your coding experiments and examples, turning your environment into a personal knowledge base.
- It enables you to run, test, and display your examples in a single app, keeping track of what you learn and showcasing your skills.
Compiled, CodeBase is an organized showcase for your examples.
In Xcode you use groups or folders to match the compiled version.
- Outline index to help you organize your notes and code examples.
- Code Templates for SwiftUI, Swift UIKit and XIB based examples.
- Document Templates for Markdown files and URLs.
On a Mac with Xcode 16.4 (or higher) installed...
- Download and open the CodeBase ZIP file from GitHub.
- Rename the folder from
CodeBase-maintoCodeBase. - Place the CodeBase folder in your Developer folder.
- Open the CodeBase Project file to open the project in Xcode.
- If a warning message appears, click Trust and Open.
In Xcode, you will need to add your bundle identifier and switch on signing.
- Use an identifier in the form
com.example.CodeBase(replacing com.example with your own reverse-DNS formatted identifier).
Test everything works by building and running.
- Close Xcode.
- Using Finder, open the directory:
CodeBase/Resources/Templates/File Templates/CodeBase Example Items/
- Place a copy of these
.xctemplatefolders in the following directory (create any missing folders):
~Library/Developer/Xcode/Templates/File Templates/CodeBase Example Items/
- Re-open Xcode.
- Select the My Examples folder in the Project Navigator.
- Press
Cmd+Nto open the Template picker. - Select the iOS tab.
- Scroll down to the CodeBase Example Files section.
- Select the type of item you want to add.
Each example item has its own folder. Within this folder, there will be a file with a name ending with "Deployment". Follow the instructions in this file to add the example to the Outline Index.
You can delete the deployment file when it is no longer needed.
You can create sections to organize your code and examples into a hierarchy.
To add a section to the outline, add Item code, like this:
Item(image: "sf.symbol", title: "My Section Title") {
// Other Items in this section go here
}...to the items property in OutlineViewController.swift.
You can mirror these sections in the My Examples folder by creating a hierarchy of folders with the same names as your section item titles.
CodeBase was created by David Kennedy.
CodeBase is available under the MIT license. See the LICENSE file for more info.


