Tag Archives: Swift


Swift Capitalize

Swift Capitalize, How to Swift Capitalize¬†is done with a string instance property. Check the example below to see how to use it. There is also a link at bottom to Apples Swift documentation. let str = “first, second, third” print(str.capitalized) Read more…


didMove never get called

didMove never get called in Xcode? didMove never get called when creating a new project with Xcode using the Game template. I selected Swift and SpriteKit. I found this issue when I was following a course on Udemy.com, and I Read more…


Swift Change UIButton text

Swift Change UIButton text How to in Swift change UIButton text?A common mistake, also done by myself some time ago, is to try to change it through an IBAction. You can use an IBAction, but probably not the way you Read more…


Swift string input

Swift string input Swift string input has become a lot easier than since I posted an article about it. In my previous article Swift string input required you to create your own function to read a input line. Then one Read more…


swift play mp3

Swift play mp3 from your app Swift play mp3 from your app with this small example. To make swift play mp3 files we need to start with importing AVFoundation. That is where the audio player is. import AVFoundation Next we Read more…


swift send email

Swift send email from your iOS app Swift send email from your iOS app. How do we do that… It was easier than I first thought. At least with this method. Using the MessageUI and have the app to pre-fill Read more…


Swift loops

Swift loops Some basic introduction to Swift loops. Swift Loops: For loop For loops are the same as the traditional C loops. If you have experience from C/C++ you already know this well. This is structured like this. for initialisation; Read more…


Swift Array

Swift array Swift Array An array in Swift, and any other programming language who support arrays, is a list of data. Those data can be any datatype. Integers, double, float, string and even classes. I will just show a few Read more…


Random numbers in swift

Random numbers in swift 2.0 Here is a short description on how to create random numbers in Swift 2.0. To create random numbers in swift 2.0 you can use the arc4random_uniform function. Check out the apple documentation for arc4random_uniform function Read more…


Swift Remove Trailing Zeros

Swift Remove Trailing Zeros In Swift remove trailing zeros is needed sometimes. When printing values, and I dont want any trailing zeros, but still need to do math with Double variables. I use two different methods of Swift removing trailing Read more…