Welcome back to TaCode Tuesdays! This is the only place you can find snippets of code for use in your very own text/voice apps, along with a weekly dose of taco puns. I’m a developer here at Zang and not only am I a big fan of tacos (if that wasn’t already apparent), I’m also a fan of open source. My goal is to share a new app idea each week that you're free to use “as is” or modify and use as the basis for your next app.
Last week, I began detailing how you can build a chat application using Swift and Zang on iOS—you can check out here, and as always, if you’d like to learn how to get started on Zang, take a look at our very first post.
This week I’m going to continue the series by walking through 4 more steps. Next week, I'll wrap everything up. I would recommend that you read the first post in the series before reading this post, otherwise it won't make any sense! Anyways, I ended on step 4 in the last post, so let's get right into step 5.
Step 5: Define your node variables and the response stream:
Step 6: Create a Node server for grabbing the method, URL, headers and body of requests. The function that's passed to createServer is called once for every HTTP request that's made against it, hence calling it the request handler.
Step 7: Create the parser for accepting data request to and from:
Step 8: After you have created your server swift web view, you can create a table-less design for your UI the resides on top of your web view, similar to this format:
Well, that’s it for now! I'll continue this tutorial in next week's TaCode Tuesday—we only have 3 more steps to go! If you have any thoughts about the app or just want to share your own taco-related thoughts, you can comment below. If you want a reminder, sign up to get notifications of new blog posts.