Tags » Swift

Class and Structure in swift

Classes and structures in Swift have many things in common.

Both can:

  • Define properties to store values

  • Define methods to provide functionality

  • Define subscripts to provide access to their values using subscript syntax…

  • 203 more words

Functions with Multiple Return Values

As Apple says:

func minMax(array: ) -> (min: Int, max: Int)? {

if array.isEmpty { return nil }

var currentMin = array[0]

var currentMax = array[0]

227 more words

Strings and Characters in swift

A string is a series of characters.

Swift strings are represented by the String type. The contents of a String can be accessed in various ways, including as a collection of… 237 more words


Closing down the keyboard

If you want to close down the keyboard when the user is tapping outside the textfield you can use the following command: touchesBegan

Like this: 12 more words


What I swizzle

Several of the talks at 360|iDev mentioned swizzling with disdain and I got some concerned looks when I mentioned using it in my app. ┬áSo…. let’s audit the swizzling used in Stack Exchange.app! 1,247 more words