DEV Community

rderik
rderik

Posted on

Swift RunLoop exploration by creating a basic shell

The RunLoop model is used extensively in the Apple ecosystem. If you've created an app for macOS or *OS you have used the RunLoop model. Also Vapor, the server-side Swift project, relies on the RunLoop model.

In simple terms, a RunLoop is a "never-ending" loop, that deals with events. For example, a shell:

  • Waits for instructions
  • You send instructions
  • It evaluates the instructions
  • Prints the results
  • And go back to listening for instructions

Simple, right? that is why I decided to use that example to explore RunLoop. If you are interested you can find the article here:

https://rderik.com/blog/understanding-the-runloop-model-by-creating-a-basic-shell/

Thanks for reading.

Top comments (0)