• Stars
    star
    434
  • Rank 100,274 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Xcode Extension for generating class diagrams from Swift code (powered by PlantUML)

SwiftPlantUML

Build Swift 5.3 Twitter

SwiftPlantUML.app

Generate and view a class diagram for Swift code in Xcode or from the Finder.

Use the hosting macOS application to configure the diagram visualization.

The Source Editor Extension (as well as the Action extension) makes use of SwiftPlantUML Swift package.

To generate a large diagram from a project with Swift files across folders then I recommend using SwiftPlantUML as a command-line tool.

Features

Xcode

  • 📊 Create class diagram from Swift file
  • 🔦 Create class diagram from selected Swift code

SwiftPlantUML Xcode Extension - Usage Demo

Finder

  • 📊 Create class diagram from selected Swift file(s)
SwiftPlantUMLFinderActionDemo.mp4

Example

SwiftPlantUML Xcode Extension - Usage Demo

Install

Homebrew

brew install swiftplantumlapp

Installation through Homebrew

Alternative

  • Download latest SwiftPlantUML package from the Releases.
  • Copy SwiftPlantUML to your Applications folder.

Enable Extension

  • Launch SwiftPlantUML.

    SwiftPlantUML user interface
  • To use in Xcode: enable extension in System Preferences > Extensions > Xcode Source Editor > select SwiftPlantUML

    SwiftPlantUML Xcode Extension - Installation

  • To use in Finder: enable extension in System Preferences > Extensions > Finder > select Open Swift Class Diagram

    SwiftPlantUML Xcode Extension - Installation

Configure

Optional:

Preferences - Elements

Preferences - Members

Preferences - Others

Troubleshooting

The command "Open editable diagram in browser" is still busy

Xcode Source Code Extension initialization might take up ~ 30 seconds on initial launch.

If the prompt does not appear within 60 seconds

image

then check for a crash report related to XPC service in Console app of your MacOS.

CrashReportXPCServiceExample

If you see such crash report related to fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed please check the installation path of Xcode. If it's installed under /Applications/Xcode.app, please run:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above with the location where you've installed Xcode.

Technical Details

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.

Acknowledgements

These awesome blog posts helped me to dive into Xcode Source Editor Extensions and XPC services

More Repositories

1

SwiftPlantUML

A command-line tool and Swift Package for generating class diagrams powered by PlantUML
Swift
584
star
2

XCSnippetsApp

macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode
Swift
160
star
3

swift-package-dependencies-check

Catch up with outdated versions based on your package dependency requirements
Shell
82
star
4

ClientCertificateSwiftDemo

iOS application to demonstrate the use of a client certificate for authentication
Swift
37
star
5

SwiftFormatPlugin

Swift Package (Command) Plugin to format source code with nicklockwood/SwiftFormat
Swift
35
star
6

OSInfo

Cross-platform Swift Package to determine OS name and version on which the app is running
Swift
30
star
7

URLCompatibilityKit

Compatible backports of commonly used type properties for `URL` that are only available from iOS 16.0+ / macOS 13.0+ / tvOS 16.0+ / watchOS 9.0+.
Swift
24
star
8

InjectSwiftUIExample

Example how to use krzysztofzablocki/Inject in a SwiftUI application
Swift
20
star
9

ManagedAppConfigurationReader

Simple SwiftUI project to showcase how to read the iOS managed app configuration from UserDefaults
Swift
10
star
10

iosdevupdates

JavaScript
10
star
11

SwiftSymbolDocMarkupExamples

Swift code base that uses and illustrates the various Markup options to create symbol documentation.
Swift
9
star
12

appleframeworks

HTML
8
star
13

swift-spi-demo

Demo of System Programming Interfaces (SPI) in Swift
Swift
8
star
14

pkce-ios-swift-auth0server

https://blog.eidinger.info/implement-oauth2-pkce-in-swift-and-test-with-auth0-authorization-server
Swift
7
star
15

TestingNSPinnedDomains

App to test SSL Pinning (NSPinnedDomains, iOS 14+)
Swift
7
star
16

me.codesnippet

Collection of Xcode Code Snippets in Swift 5+
5
star
17

MissMinutes

macOS menu bar app to display my favorite timezones
Swift
4
star
18

Repeat

Demo of using Swift Argument Parser and await/async
Swift
4
star
19

XCSnippets

Swift package to interact with Xcode Code Snippets in a type-safe manner
Swift
4
star
20

objc-load-and-swift-interop-demo

Automatically run Swift code when your framework gets initialized
Objective-C
4
star
21

swift-biometric-authentication-simulator-demo

4
star
22

cordova-disable-copy-paste

Cordova Plugin for iOS to prevent copy-paste to other applications
Objective-C
3
star
23

conditional-files

CLI tool to mass insert/delete conditional compilation statements
Swift
2
star
24

iOS-System-Symbols-Utilities

Utilities around iOS system symbol. Useful for symbolicating iOS crash reports.
Shell
2
star
25

swift-swagger-mockoon-tutorial

2
star
26

swift-swizzling-uipasteboard-demo

2
star
27

FioriChartsInWidgets

Swift
2
star
28

cordova-paramedic-travis-ci-howto

HowTo: Use cordova-paramedic and Travis CI for continuous integration
2
star
29

MarcoEidinger

1
star
30

plcrashreporterusage

iOS application in Swift using reliable, open-source crash reporter PLCrashReporter (Objective-C)
Perl
1
star
31

spm-binaryframework-update-with-ghaction

Demo how to use a GitHub action to update binary target information
Shell
1
star
32

swift-api-assign-reviewer

GitHub action to detect access control changes (open/public) in Swift files and set reviewer/assignee to pull request
TypeScript
1
star
33

swift-package-monitored-by-dependabot

Swift
1
star
34

getting-started-with-spm

Material for my tryswiftworld workshop "Getting Started with SwiftPM"
1
star
35

GitBisectXcodebuild

Demo on how to use git bisect with xcodebuild test
Swift
1
star
36

OsmiumAtlas

CLI to verify the feeds listed in iosdevdirectory.com and is the foundation for iosdevupdates.com
Swift
1
star
37

ms-adaptivecards-ios-example

Example of rendering an Adaptive Card (Microsoft) on iOS
Swift
1
star
38

cordova-plugin-plcrashreporter

Objective-C
1
star