This repo is my workspace for Example Code for Step Into Vision.
- All labs are posted as articles on the site: https://stepinto.vision/category/labs/
- To see the code for a given example, look in
Step Into Examples/Examples - Some examples require full Xcode project. Those are in another repo: https://github.com/radicalappdev/Step-Into-Example-Projects
I'm not currently accepting pull requests. If you would like to suggest an example, please contact me. Links are in ny GitHub profile.
Support my work
The huge switch and ModelData array are now generated from the example files themselves.
Each example already has a short metadata header the generator reads:
// Title: Example150
// Subtitle: Something cool
// Description: A short description
// Type: Volume // Window | Window Alt | Volume | Space | Space Full
// Featured: false
// Success: trueRegenerate the registry (App/Generated/ExampleRegistry.swift) any time you add or change examples:
xcrun swift Tools/generate_examples.swiftIf you want Xcode to trigger this for you, add a Run Script build phase (runs on every build):
- Select the app target → Build Phases → + → New Run Script Phase.
- Paste:
set -euo pipefail SRC="$SRCROOT/Step Into Example Code/Examples" OUT="$SRCROOT/Step Into Example Code/App/Generated/ExampleRegistry.swift" xcrun --sdk macosx swift "$SRCROOT/Tools/generate_examples.swift" --src "$SRC" --out "$OUT"
- Drag it before “Compile Sources”.
- Inputs:
$(SRCROOT)/Tools/generate_examples.swift,$(SRCROOT)/Step Into Example Code/Examples
Output:$(SRCROOT)/Step Into Example Code/App/Generated/ExampleRegistry.swift - To avoid Xcode sandbox blocks, set Build Settings → User Script Sandboxing (ENABLE_USER_SCRIPT_SANDBOXING) to No (you can limit this to Debug).