Moving from Objective C to Swift

So I think I’m finally going to attempt to make the transition from Objective C to Swift. I’ve been putting it off for a long time, and I finally have a new project I’m going to piddle with, so it seemed like a good time. I’m a bit sad because I’ve finally become pretty proficient in Objective C and leaving it for Swift will be tough. I don’t write Objective C for work or anything, so everything I have done with it has been at home. This means it takes me longer to get up to speed on everything because I play with it in my free time. I have VERY little free time right now so it means it will be a slow learning experience.

So far I have been able to do everything I want with the Apple APIs but I think its just a matter of time until that isn’t the case. If this really slows down my project or myself (aka I move at like CS101 type pace) than I am definitely going to be switching back to Objective C until I’m forced to give it up.

Hopefully this is a smooth process… wish me luck!

Adding Logos

So how in the world did I not know about Automator on the Mac until roughly December?  I feel like this is something I should have known about, but apparently I am a bad Mac user because I didn't. :( So how did I end up finding Automator?  Pure laziness...

A little while ago (aka I can't remember when) Brittany and I talked about adding a logo to the images on her site.  Brittany started adding her logo to her images and it was taking her forever to do it.  She was adding the logo one image at a time.  After looking at it and thinking "I wonder if I can automate this" I started brainstorming.

My first thought was to write her a tool in Objective C because that's what I know and I think I could do a good job with it.  Being an engineer my mind definitely started over engineering the project.  I started thinking of a lot of fun things I could do in Objective C.  This started becoming another programming project I figured I would never finish...  (I have quite a few of them).  So I did a Google search for "Batch Pixelmator images" (We use Pixelmator for most of our work with images) and then I learned about Automator.  I also learned that Pixelmator has great Automator support.

I started making some pretty fancy Workflows for Brittany that copied and moved files.  They worked really well, but it did more than what she wanted.  So much for not over engineering huh...  I ended up making a simple Automator Service that just adds her logo to the images.  It's a permanent addition to the image, but that's what she wanted!  So now all Brittany does is highlight all the images she needs for her blog and then she right clicks, hits "Add Logo," and BOOM all her images have her logo.

So the only downsides to what I have built is that the logo is only one size.  So whether she is adding the logo to a HUGE image or a small image, the logo is the same size.  Of course now I want to write a more complicated Automotive Service to adjust the logo size...  Or maybe I go back and write something in Objective C when I find time....

 

Using External Code Libraries

So programming is one of the hobbies I have.  I don't consider myself a good programmer, but I'm a decent one (or so I think).  Most of what I have done lately is pure Objective C and Swift stuff (mostly Obj C but I have toyed around with Swift).  I have written apps that were published in Apple's iOS App Store, but I have never depended on my programming ability for my actual income.  Everything I do now is mostly hobby stuff, but it may one day end up leading to a new app.

One thing I have always strived to do is not to use any external libraries or resources outside of official APIs.  I always try to write my wrappers, classes, and everything on my own.  Even though I know there are TONS of libraries and code examples on GIT Hub, StackOverlfow, etc, it still makes me uncomfortable.  I'm worried about unexpected bugs I have to troubleshoot, code no longer being maintained, code I didn't write becoming obsolete, etc.  This can make for a frustrating experience.  I mean what happens if your app bases itself off of a library someone random maintains, they decide to stop all work on it and pull it offline, and now you are up a creek without a paddle (see the whole Parse situation, even though they at least tried to help the situation).

Recently I've actually thought about using two different external libraries because I honestly don't have the time lately to really sit and deep dive into a new topic (having a newborn baby can have the effect on you, but man she is awesome).  I want to be able to use CloudKit outside of the App Store and the only way to do is that is to use the CloudKit web services or JavaScript  frameworks for CloudKit.  Now I have NEVER written JavaScript before and honestly, didn't want to learn how. It's not that I don't think learning JS would be useful; I just have had to pick and choose what I want to learn.  I have looked at Agilebit's AgileCloudSDK and I like how it works.  I've also looked into using some sort of wrapper for the FSEvents API.  Mainly that's because I don't want to really dig into a C API.  While I would love to spend a lot of time learning everything, I just honestly don't have the time.  I'm lucky to just be able to write anything I already know!

While the apps I released in the App Store were all 100% my code and not dependent on others resources, I can see myself using a few libraries in the future.  I try to truly vet the libraries to make sure they are "future proof" and at least have source code available for me to use.  Anything closed source I won't use because I can't change something in it, and I am not sure what all it does (outside of what's documented).  

Hopefully my future does not involve using many of these libraries or code snippets.  I honestly believe buggy and bloated software has increased because people carelessly use unknown code and snippets.  Just because something works that you copied off StackOverflow does not mean it is the right solution.  Let's hope I don't get that lazy and undisciplined as I continue my coding adventures.