Archives for 

Advanced Functions

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

Saving and Loading Text in Swift

    Here is a full solution on saving and loading text with Swift 2.0, current example is for saving and loading high score in a game. Using those 2 functions we can now declare a variable to store a path to our highscore text file: Here is how we would load  text […]
6

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

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

Creating a Tap Gesture

Hi, here is a basic example of creating and applying a tap gesture. This is one of the simpler gestures and it’s fairly easy to use. First we are going to create the Gesture Recognizer, using the built in UITapGestureRecognizer function provided by Apple. Please make sure the matches the function name below. […]
0

Creating a Rotate Gesture

Here is a complete Rotate Gesture example: We have 2 things – a handle and the gesture itself that uses the handle.. Here is the gesture: is what points to the Handle ( make sure you don’t misspell this). Here is the actual handle:
0

Creating a Pan Gesture

Here is a complete Pan Gesture example: We have 2 things – a handle and the gesture itself that uses the handle..   Here is the gesture: is what points to the Handle ( make sure you don’t misspell this ).   Here is the actual handle:
0

Creating a delay function

A delay function is something that is always useful. Uses are really countless. Here is one of the best methods I’ve come across. First you create the function: And then you just use it whenever you need to:
0