Friday night – Swift Tailor

No.. not Taylor Swift.. I mean that I finally took the time to try out the new Swift programming language for my iPhone and iPad. I used to use Objective C.. which was pretty complicated…

 

Swift is a more modern language designed for morons  like me. It really is fun to program.. My first attempt was a tutorial by a guy named Wei-Meng Lee that coupled a TI sensor tag to my phone or table to allow you to take remote selfies.. How cool is that ?  I took advantage of a couple of boring meetings (not with any of you) to do my coding as I listened)

 

The Sensor tag is this very cool $25 dollar wireless gizmo with thermometers, barometer, accelerometer, magnetometer, gombometer (remember gumby ?)..

 

here’s the Storyboard for the design in Xcode

and heres a little bit  of the swift code.. almost all of it in one file

 

And here’s the result.. you click the button on the sensor tag and it takes your picture. how cool is that

 

i fee proud of myself l like a kid who just tied his own shoe for the first time.. !

you’re never to old or weird looking to learn.. are you ?

 

nite all, nite sam

-me

 

One thought on “Friday night – Swift Tailor”

  1. I recently dusted off my old notes and books on programming myself, hadn’t done anything in years. Was about to go in for spinal surgery on my neck and to occupy myself I remembered some old coding projects that I was sure I could improve upon or simply make work now. It was a blast diving right back into working on some code. I never learned any Objective C, to be honest I started out on Basic and worked into Visual Basic.Net. That is what I still work in from time to time, Visual Basic.Net. Microsoft distributes a very handy tool for working with Visual Basic.Net with their Visual Studio software. The project itself started off fairly easy as things go but as usual I found myself trying to grasp new concepts, figure things out and make stuff work that I had never tackled before. There is always a new puzzle to crack and new tricks to tackle, isn’t there?

    The whole program was a digital data sheet of sorts for fictional characters to be used in a table top game. In a nut shell it allows a player to input in values representing how strong, how fast, how tough etc. that their particular character is. When they enter in for example how strong their character is it calculates various derivative values and applies them to other aspects of the character. So, let’s say if they are a relatively strong character then it calculates an appropriate modifier that it can apply to determine how much weight they can carry with ease, how well they can perform certain activities like feats of athletics all the way down to how hard they can hit something in a fight.

    It took some time to iron all the kinks out. The program allows for a user to save their data for later use, print that information out in a manner that retains a familiar layout that the application uses. It had optional tool-tips that could be hidden or enabled by the user to provide displayed help or information. There was even additional input fields that the user could toggle off or on to be visible specifically based upon their preferences or needs.

    I was particularly proud of the fact that I was able to discover a method for clearing all user data by coding a sub that reset or cleared all data fields by their type. There was a lot of fields; text boxes, list boxes, check boxes – you name it. Before I had to resort to manually inputting a line by line approach that set each input field to a defined empty value. It was a huge and satisfying moment. You can easily become blind to just how rusty you have become much less how much you might have forgotten. Luckily for me I was fortunate enough to stumble upon some great online resources and message-boards with incredibly supportive/helpful users who provided so much advice and instruction.

    The whole thing was just the distraction I needed to absorb all my attention and keep myself busy. I’d been struggling with issues affecting my right arm for the last few years and they progressively became worse. There was constant nerve pain in the form of electrical burning, loss of feeling and even the inability to use my right(my dominant hand). The surgery on my neck was one that I had no guarantee would prove successful, and I won’t deny it; I was incredibly nervous and not just a tiny bit scared. So I kept trying to find things to keep my thoughts occupied. Once my initial project was completed I was more than lost – I was certain it would take me longer to get everything working. So that prompted another project… I had forgotten just how much I adored working on programming, especially the learning new things as I went and figuring out the problems I ran into. I’d also forgotten just how easy it was to loose myself and become consumed with working on some code.

    I’d be happy to share with you some screen shots or some copies of the code if you’re ever curious. Visual Basic.Net is a great language in my opinion; it’s flexible and easy to work with while also being easy on users – all they need is the .Net framework that Microsoft makes available and already installed on most PC’s. Using Visual Studio you can layout a graphical layout/interface that is easy to work with. It can be as simple as double-clicking on a text box to generate a piece of code that you can define to handle events like when that field’s text is changed etc. Granted I am a bit biased because it was the language I studied in college and never got the opportunity to study any others. Your work with this Swift language is absolutely fascinating – if perhaps somewhat out of my league. It inspires me to challenge myself to improve on my own programming knowledge and, who knows; maybe I will finally knuckle down and give a try at learning another language myself. I keep meaning too but always run into some form of roadblock. I’m already recovering from my surgery and seeing as how the pain in my arm is gone(neck is still uncomfortable, there is still no feeling in my arm but if I keep my eye on where my hand is positioned I can use it some excluding any grasping/manipulation of anything more than simple typing or tying my shoes) now might be a good time to apply myself once more.

    Congrats on the project and the new knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *