Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add images to the comments of code in Swift?

Basically, I am writing a program that involves a lot of trig and mathematical manipulations that will later on have to be reviewed. Explaining what is happening in this section of the code with words is hard. I was wondering if it's possible to add a diagram in the comments of the code to help ease an explanation?

Thanks!

like image 656
Giulio Crisanti Avatar asked May 05 '16 20:05

Giulio Crisanti


1 Answers

If you ship your code as an Xcode playground, you can have your comments styled as rich text with Markdown formatting, and add hyperlinks and images. (A playground is a file package — a folder that looks like a single file — so you can put your image files inside and reference them from the playground source, and they'll render inline with the rest of your markup.)

As noted in comments, Apple has docs explaining the comment formatting for images and other markup.

like image 76
rickster Avatar answered Nov 15 '22 00:11

rickster