Online editors from where we can write, and in some cases execute, code, there are many, but what glot.io offers is worth mentioning.
It is a project in which users send snippets, pieces of code that perform a specific function and that can be used in a larger program, so that other people can take advantage of it easily.
Glot.io offers an online editor from where we can write in various programming languages, including Swift, and view the result in a simple way, since the code runs inside an internal container, without the need for a network connection. The execution time is limited to 15 seconds, and the output cannot exceed 100 kiB, but it is enough to test basic snippets.
Each snippet can be saved publicly or privately, so it is also possible to use it as a personal database, not as a social network of programmers, and in case of making them public they will be available from the search engines (those that are in secret mode, only accessed via specific url).
The project has the code available on github, ready for other people to analyze and improve it. At the moment you only have to enter, select the desired language, and start programming and saving the programmed, as well as open what others have done to analyze line by line.