Category: iOS
How to install new Xcode themes
If you are not that satisfied by the default syntax highlighting in Xcode and the pre installed themes aren’t that useful for you there is an easy way to install some new ones. At first, open Finder and navigate to:
~/Library/Developer/Xcode
(to do so press cmd+shift+g and type in the folder). now create a new folder called
FontAndColorThemes
You are now ready to color up Xcode with new themes. To find some a good starting point to search on github.com for “Xcode themes”. Typically you will find a file with the ending:
.dvtcolortheme
Copy this file to the newly created directory. If you restart Xcode now you will see your installed themes under Preferences-Fonts & Colors. If everything went fine it should look like this:
Saving data with UIDocument in iOS
Reading and writing data in iOS is a crucial thing if your app depends on it. In my app Stepr (iTunes link). I’ve made the naive mistake to save all my data into a plist file with a (too) simple mechanism and made my users not very happy with this approach. Stepr is basically a pedometer which reads the data from the M7 coprocessor in the iPhone 5s, compares it to a goal set by the user and saves all steps of a day into a file (more on this in a separate post). The user can view all the recorded steps afterwards in a statistic and watch the overall progress.
So what was wrong with saving into a plist file? In general – nothing. If you when your data is loaded and ready to get saved you are (probably) fine. But for Stepr things are a bit more complicated. The app utilizes Background Fetch to update the data even when the app is not active. Stepr will be launched in the background and gets about 30 seconds to do its stuff till iOS will quit it and querying the CoreMotion framework is threaded too, so you don’t really know when updates are done. So in the worst case Stepr tried to load data, tried to update it and saved it at nearly the same time. Data got corrupted and the plist file was broken – not good!
The solution to this problem was to switch to UIDocument for file operations. But how to do it right? I asked this question myself and found a very very good tutorial from Kevin Hunter from Silver Bay Technologies on how to implement UIDocument for your file operations. And the best thing of all – the tutorial also covers unit tests and test driven development (TDD)! After working through it my document knows when loading data is done, when it has unsaved data and when the data is saved – the data management in Stepr is very robust now…awesome!
Because of this tutorial I was able to solve my problem for Stepr, learnt a lot about TDD and had also some knowledge on how to develop a mechanism to migrate from the old plist file to the new UIDocument powered file with unit tests and all the nice stuff.
I just can highly recommend to read this tutorial, it’s one of the best I’ve found so far! (Link)
iOS 7 Tech Talks – Game Developer Day in Berlin
On December 13th 2013 I had the chance to attend the iOS 7 Tech Talks Game Developer Day from Apple at the Maritim Hotel in Berlin. In short: it was amazing!
I’ve met some interesting people to talk about iOS & game development and got a lot of information and tips. The presentations were hold by Apple Developers and had many useful hints and tips to improve Apps and software in general. One of my favorite presentations was the one about OpenGL ES 3.0. It’s truly awesome what mobile devices are able to do these days!
Next to the presentation room was a lab where you had the opportunity to talk to the developers from person to person. For me this was one of the highlights of the day because they gave me a lot of input for some of the projects I am working on. Everyone was willing to help you on your problems and it’s great to discuss stuff of your apps directly with people with tons of experience.
To summarize, it was a very interesting day and I think it’s great that Apple cares so much about the developers! I hope that I will have the chance to join some of this kind of event (WWDC? ;-) ) again, even if it was a bit stressful after all (there was the christmas party of my job the same evening in Dresden…)!
If your are a in the iOS Developer Program you can watch the presentations here: https://developer.apple.com/tech-talks/videos/
Unity 3D free adds iOS & Android build options
best news since a long time…now everyone can build mobile games with Unity for free. instead of charging $800 for both you now pay $0!
go grab your copy at http://unity3d.com/unity/download/
Back on track!
It’s been a while since my last regular posts and some code too…
Anyway, here we go. I’ve got some time and a iPhone 4s, so I started to do some openframeworks [OF] stuff on it. OF seems to be very evolved on iOS, which is really nice to get started! Even though cinder supports iOS too, OF does it’s job very well.
My first experiment is some spirographic thing which is inspired by “Wave Clock” from Matt Pearson (I am reading his book on Processing at the moment, which is very good! ( the book is called generative art, a must read if you’re interested in creative coding!)
The graphics style of the “app” is some kind of retro styled. I think I will do some more stuff with this style, I really like it. Touch gestures are also supported. You can control the density of the single lines, change their length and color too. These few settings already give some very interesting possibilities to work with. Next step is to get smooth & automatic changes of the lines in an animation.