# Swift Playgrounds by Category

{% tabs %}
{% tab title="Computer Science Theory & Algorithms" %}

| Swift Playground      | Topic                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------- |
| Factorial             | Very simple demo of a recursion algorithm in Swift                                      |
| Function Call Mapping | Demonstration of calling functions dynamically using a routing pattern                  |
| Syntax Tree           | Demonstration of a tree algorithm adapted to the Swift programming language             |
| Tail Recursion        | Demonstration of the tail recursion algorithm adapted to the Swift programming language |
| Using Opaque Types    | Demonstration of using Swift opaque types                                               |
| Using Phantom Types   | Demonstration of using phantom types in Swift                                           |
| {% endtab %}          |                                                                                         |

{% tab title="Networking" %}

| Swift Playground                 | Topic                                                                                                                                             |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| DNSResolve5                      | Resolve host names from a given  IP address using Apple’s Core Foundation with `CFHost`. This *won’t* resolve the host alias names, though        |
| IPHostAddressResolution5         | Resolve host names from a given IP address using GLibC’s standard networking C function `gethostbyaddr`. This *does* resolve the host alias names |
| IPHostAddressResolution5 SwiftUI | Same as `IPHostAddressResolution5` with a simple UI                                                                                               |
| {% endtab %}                     |                                                                                                                                                   |

{% tab title="Integrating C" %}

| Swift Playground                 | Topic                                                                                                                                          |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| IPHostAddressResolution5         | Resolve host IP address by a given name using GLibC’s standard networking C function `gethostbyaddr`. This *does* resolve the host alias names |
| IPHostAddressResolution5 SwiftUI | Same as `IPHostAddressResolution5` with a simple UI                                                                                            |
| {% endtab %}                     |                                                                                                                                                |

{% tab title="SwiftUI" %}

| Swift Playground                 | Topic                                                                                                                        |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| IPHostAddressResolution5 SwiftUI | Same as `IPHostAddressResolution5` with a simple UI                                                                          |
| Pulsating Custom Button          | A custom SwiftUI button with a blinking LED indicator mimicking buttons found on KORG’s synthesisers                         |
| QR Code                          | How to platform-independently generate a bitmap QR code using Apple’s CoreImage `CIFilter`                                   |
| QR Code iOS                      | Same as `QR Code`, specifically designed for i(Pad)OS                                                                        |
| QR Code macOS                    | Same as `QR Code`, specifically designed for macOS                                                                           |
| SpeedMaths                       | A simple example of using a list view with a custom row content view with field-exit handler and context-dependent colouring |
| {% endtab %}                     |                                                                                                                              |
| {% endtabs %}                    |                                                                                                                              |
