Skip to content

Instantly share code, notes, and snippets.

@patzearfoss
Created September 6, 2015 04:36
Show Gist options
  • Save patzearfoss/3cadc3090759306f2028 to your computer and use it in GitHub Desktop.
Save patzearfoss/3cadc3090759306f2028 to your computer and use it in GitHub Desktop.
Shows some funky(func-y) stuff in swift
//: Playground - noun: a place where people can play
import UIKit
var f_var: () -> String = {
return "Wat"
}
let f1: () -> String = {
return "Indubitably"
}
let f2: () -> String = {
return "Sure, why not?"
}
f_var = f1
print (f_var())
// =============
func g() -> String {
return "gee"
}
print (g())
var s = "the letter s"
func capture_g() -> String {
return s
}
capture_g()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment