My History with Cell Phones

The first smart phone I ever got was a android. It was a small thick brick from HTC, that did everything that I could ever want. Then after awhile I decided to switch carriers, which lead me to experience one of the first windows phones, it was a Nokia Lumia 920. And after that I moved on to a number of different BLU phones. The BLU phones that I bought were nice, but I kept up grading every 8 months to half a year.

As you can see I am a pretty fickle person, I am always looking for the next cool new thing. And last year I spent the most I had ever spent on a phone up until that point, and bought a Asus Zen Phone. It was the best android phone I had ever had in my life. It was super fast, responsive, reliable, and had great battery life.

Things were going well with the phone for a while there, and for a reason I can’t remember to this day I ordered an iPhone.  I bought a used 6s which I kept for a few weeks, until I realized that I needed more storage. At which point I returned it and bought another 6s with more storage. And then I realized the battery life wasn’t good enough for me. So I went ahead and dropped 1300 dollars on a brand new iPhone 7 Plus with 128 GB of storage.

I am not sure why I bought a iPhone. I think its because I wanted to make apps for it, and wanted that brand name 🤩 After having it for a few months I found the experience to be very very alright, nothing insanely special. I still have the iPhone and don’t plan to upgrade it for a long long long time.

I kinda regretted buying it for a few months until I started to mess with iOS’s new features, ML and AR. Both of which are interesting to play with, but as you can see from the app store it not like every other app out there has AR or ML in it.

WTF is a Protocol ?

This part of the Swift language is pretty simple to explain. A “Protocol” is what is called a “Interface” in most of the other languages out there. It is basically a set of rules that your struct, class, or enum has to conform to.

You maybe asking your self “why would I ever need this weird construct ? I know whats what. I don’t need these things if I am doing it all myself. ” Well thing is that it keeps you honest, and it keeps you on track.

More importantly it opens the door to things like delegates. More on this in my next blog post.

WTF is an Optional ?

Long story short, it helps you with the turning nothingness into somethingness, or at least simulates a sort of nothingness.

In most languages out there like C#, if a variable does not get initialized with a value or is not set to any value, it’s value is “null”. Knowing this, you can go about your life as programmer knowing that you just have to check if that variable is null before using it, and your good 😎

However with Swift that is simply not the case.  That is due to the fact that the Swift language does not allow variables to be “null” (In Swift its “nil”) at runtime. It believes that every variable has to have some sort of value. To combat this Optionals came into existence. What Optionals do when Swift asks them if a variable is “nil’, is reply with a “maybe, who knows” and Swift moves on.

Literally speaking here Optionals are just a offshoot of your standard variable that may or may not contain a value. This way your never left wonder why something didn’t have a value, when you thought it would.

Heres a coding example shown below: