Generate and view a class diagram for Swift code in Xcode with this extension.
This Source Editor Extension makes use of SwiftPlantUML Swift package. You can also use SwiftPlantUML
as a command-line tool.
- 📊 Create class diagram from Swift file
- 🔦 Create class diagram from selected Swift code
- Download latest SwiftPlantUML package from the Releases.
- Copy SwiftPlantUML to your Applications folder.
- Launch SwiftPlantUML once. You can close it immediately afterwards (i.e. Quit from Dock).
- Go to System Preferences > Extensions > Xcode Source Editor > select SwiftPlantUML
This Source Editor Extension makes use of XPC service to run the app sandboxed and use SwiftPlantUML
(and its dependency SourceKitten
). Source Editor Extensions using SourceKitten
(either directly or indirectly) have to either run in a non-sandboxed app (and could not be distributed via the App Store) or use XPC service to outsource the use of SourceKitten
to a different process.
These awesome blog posts helped me to dive into Xcode Source Editor Extensions and XPC services