Author: larsoleruben

Learning Swift

There are some great tutorials from Ayaka Nonaka in this blog. Well worth checking it out. Especially the part about optionals and enums.

Posted in Uncategorized

Great tutorial for iOS animations

Do you think the standard UIActivityIndicatorView is a bit boring (has only gray an white) and that the size is too small? Despair no more. Here is a great tutorial and it is just a few lines of code and you

Posted in Uncategorized

Testing callback with delegate methods in Swift

Apple has now made it possible to test callback methods in unit tests for swift. It works great on callback methods directly, but also works if you have delegates reacting to the callback in another class The trick is to

Posted in Swift Programming

Be careful with Int and 32 and 64 bit architectures!

While I was doing a new App, I did all the development using Iphone 5s as the base model in the simulator, just testing it a few times om 6 and 6 plus. However, as I had submitted it to

Posted in Swift Programming

Flappy Birds Clone: Using SPRITEKIT for the first time ever

As a complete beginner in SpriteKit, I am amazed how easy it was to make a Flappy Bird clone (with some help from a course). flappybirds Quite fun too to play around with actually.  

Posted in Swift Programming

Handling strings in Swift is STRANGE!

Some hints and links   1) Handling substrings See this excellent website about using the strange new string.substringwithrange( range: Range<String.Index>) and the String.substringFromIndex( index: String.index) let myString = “[ABCDEFGHI]” let startIndex = advance(myString.startIndex, 1) let endIndex = advance(myString.endIndex, -1) //start- and

Posted in Uncategorized

Using the UIAlertController in Swift (iOS8.1)

Swift (and objective C) comes with a handy way to handle login, confirmations, etc in alerts. Here is an example func handleParseLogin(){ let alertController = UIAlertController(title: “Login!”, message: “Please log in to the app”, preferredStyle: .Alert) let loginAction = UIAlertAction(title:

Posted in Swift Programming