Question or problem with Swift language programming:
I have created an iOS mobile application. I wanted to know if there is a way to generate UML Class diagram for swift programming language?
I have tried Omni Graffle but it keeps saying that the project doesn’t contain Objective-C interfaces. And Omni Graffle only does this for objective-c. Please help.
Thanks in advance.
How to solve the problem:
The answer unfortunately is: you can’t do it. At least not automatically. Swift as compiler itself has enough flaws left. Leave alone some tool will be able to swallow any Swift code. Your only alternative is the good old manual way.
I know that Enterprise Architect has a possibility to define a language syntax based on BNF. But Swift is (again unfortunately) not context free. (In fact it’s so context sensitive that it often swallows its own rear.) So that won’t work either.
P.S.: Now that Swift is open source someone might take the opportunity to tap the compiler’s output for the class interfaces. I guess that should not be too difficult, but it’s a lot of work still.
I remember looking at this question a while ago and was disappointed that there wasn’t any tool like this so I created one myself with the help of a colleague. It’s free, it’s open source, it’s looking for contributors…
And here’s a tutorial on how to use it (don’t worry it’s very simple):
Happy diagraming 🙂