# Swift Playgrounds - Pixelblaze

**URL:** <https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154>\
**Category:** Ideas and Tips\
**Created:** [April 8, 2021, 6:54pm UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154 "2021-04-08T18:54:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamehana](https://forum.electromage.com/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@Kamehana](https://forum.electromage.com/u/Kamehana)\
**Post date:** [April 8, 2021, 6:54pm UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154/1 "2021-04-08T18:54:36Z")

</div>

Hello:

I am looking to develop a version of the PB web interface as a Swift Playgrounds app. A version without the 2D / 3D mapping. I would like advise on the best way to approach this challenge. For example, would using the [Pixelblaze-Client](https://github.com/zranger1/pixelblaze-client) created by zranger1 be a starting place for identifying the fundamental components necessary to recreate basic elements of the PB web interface? Or might there be a template for what would be required to develop the features that are currently present in the PB web interface? Any advise or suggestions would be appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [April 9, 2021, 3:52pm UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154/2 "2021-04-09T15:52:19Z")

</div>

Disclaimer: I haven’t had an Apple machine for development since Objective-C was king, and have only a passing familiarity with Swift, and none at all with the playground. Still…

The Web UI uses both http and websockets protocols, a couple of different data encodings, plus decompression of the pattern binaries to access preview images if you want them. It’s a non-trivial undertaking. I’d do it in stages, probably starting with using the websocket interface to control the Pixelblaze.

You can get information on protocols from pixelblaze-client and the [Firestorm source code.](https://github.com/simap/Firestorm) I’d also recommend looking at @nick_w’s [async python library](https://forum.electromage.com/t/new-python-library-posted/1130), because the async model is a better fit for Swift, and it also has some code dealing directly with binary pattern files.

---

<div class="post-metadata">

**Author:** ![Kamehana](https://forum.electromage.com/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@Kamehana](https://forum.electromage.com/u/Kamehana)\
**Post date:** [April 9, 2021, 7:42pm UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154/3 "2021-04-09T19:42:55Z")

</div>

@zranger1  
Currently, I am able to use the websocket to control the PB. As I am in the early development stages, I am still working out how much of the PB web interface I need to recreate. Ultimately this project will be an app to introduce middle-schoolers to coding.

Thanks for the information. I appreciate the work that you did on the Python library.

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [April 10, 2021, 2:17am UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154/4 "2021-04-10T02:17:57Z")

</div>

There’s no tougher or more worthwhile task than getting kids to understand how fun and useful it is to know something about programming. Awesome! I look forward to seeing what you come up with!

---

<div class="post-metadata">

**Author:** ![Kamehana](https://forum.electromage.com/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@Kamehana](https://forum.electromage.com/u/Kamehana)\
**Post date:** [April 10, 2021, 2:57am UTC](https://forum.electromage.com/t/swift-playgrounds-pixelblaze/1154/5 "2021-04-10T02:57:53Z")

</div>

Absolutely. Happy to share.
