Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@izotx
Created May 25, 2017 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izotx/fca648a578f6e1a351e82623bf748338 to your computer and use it in GitHub Desktop.
Save izotx/fca648a578f6e1a351e82623bf748338 to your computer and use it in GitHub Desktop.
import UIKit
class DataSource{
//Static method - no need to initialize the instance of the class
class func locations()->[String]{
let a = "a"
let b = "b"
return [a,b]
}
}
//Usage
let locations = DataSource.locations()
//notice that we don't have to create an instance: let d = DataSource()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment