So I decided to step a little bit out of my comfort zone professionally and try myself outside the scope of web development. I took a beginner course on Udemy about developing iPhone apps using Swift, but up until today I didn’t write a single line of Swift code. I hereby challenge myself to write my first app in 14 days. Now the app itself most probably won’t be ready for the app store straight away since I’m mostly focusing on functionality and not usability / design but it will be a good learning experience for me.
The app: The app will be a very simple game. Imagine a massive, 1 billion step board game with one single player. Everyone who is using the app will move the same player by answering trivia questions. If a given user answers the question correctly the player moves forward 1 step, otherwise it moves backwards one. I know, not the most original idea but it really is just for learning.
So here is what I did today (keep in mind I have literally no idea what I’m doing so probably I’m doing it all wrong)
I started off building a basic interface. What really surprised me, coming from web development, is how un-intuitive xcode’s interface (storyboard) builder is when it comes to “responsive” design. It took me ages to figure out how to make a single button stretch when I switch the emulator from iPhone 5s mode to iPhone 6. Basically you have to define the relative distance between the elements and the main view and the buttons will stretch to fill the space. I mean it kinda makes sense but how hard would it be for to allow defining sizes in %? Anyway my lame interface looks like this at the moment:
I know, it looks fugly but it renders properly in the simulator (still fugly but at least symmetric)
I can’t believe I spent like 3 hours on this, but at least I learnt something. Besides the interface I defined my outlets and set up a base controller which will handle my interaction with the (so far non-existent API) and update the interface elements as needed.
It really is a frustrating yet very fulfilling experience to code for iOS. I mean it is one thing to switch from PHP to Python but it is completely different when you are switching from web dev to desktop / mobile dev. I think the last time I had to deal with pointers and complex types was when I was like 14 coding in Borland Pascal.
Tomorrow I’m gonna hook up my class with a stub API and do some actual work on the logic. Will keep you posted (not like anyone is reading this)