Archives for 

xcode

Delay Function in Swift 3.0

    Since thing have changed a lot for Swift 3.0 , here is a quick tip on how to create a delayed function with the new API. Add this function to your project: Then if you want to launch anything after a delay, you use it like so: That’s all ๐Ÿ™‚ Cheers!
0

SpriteKit Game From Scratch, Swift 2.0, part 3

    Introduction Before I go on with this tutorial I just want to say a few words. The tutorial is getting quite long and for a few good reasons – I am trying not to leave a lot out and I am writing in in a raw format, meaning I am not refining it, […]
0

SpriteKit Game From Scratch, Swift 2.0, part 2

    Introduction   We’ll continue with our tutorial on creating a SpriteKit Game from scratch. Last we took off where we were able to create an instance of our hero on every tap on the screen. However we won’t really be creating our hero or the enemy with a tap on the screen, we […]
8

Generating UIButtons from a loop, part 2

Hi, creating a second part of the tutorial as some folks wanted to do this trick with a few variations. ( link to part I ) As a start a Navigation controller got involved ๐Ÿ™‚ So you end up with a problem where buttons would disappear as you go back and forth. Solution for this […]
8

Creating a HUD for your Sprite Kit Game

Creating a HUD for every game is vital. It’s a bit tricky when you are adding UI Elements to Sprite Kit and there are also a few different ways of doing it. Here is one of the ways and so far my favorite. It’s very flexible and it will allow you to easily customize your […]
8

Generating UIButtons from a loop

This is a very useful technique and it’s pretty straight forward. Let’s say we have an array of items or heroes and we want to dynamically create buttons that will do something linked to the hero/item selected. One example is if you have an array of saved games and you want to generate buttons to […]
20

Setting up backgrounds for UIView

There are different ways of setting up backgrounds in Swift, depending on the object, method, background type etc. We will go through some of these here. Setting up a background image for a UIView: Replace “myImage.png” with the name of your image. Note: Make sure you add your images to the Bundle first. To […]
0

Contacts App / Inventory with Archiving 2.0

Hi, all Here is the updated version of the Contacts app with archiving. It will now let you save and load multiple contacts. I am just going to list some of the new things added. Here are the previous and next buttons on the Load View screen:       Here are the […]
2

Multiplications Table app

Ok, this app will be just an example of how to create things programmatically, without using the Auto Layout or any of the other fancy things within XCode. It’s a very simple app, but to me it was a very good experience learning to build and troubleshoot things directly in code. The app will look […]
1