Skip to content

Instantly share code, notes, and snippets.

View randomstep's full-sized avatar

Step Christopher randomstep

  • Integral Software inc
View GitHub Profile
@randomstep
randomstep / DependencyInjection.swift
Last active September 3, 2015 07:49
show simple dependency injection EDIT: Ok really just dependency inheritance
// do DI easy with protocol / extension?
class PostcardStore {
let postcards = ["France", "Romania"]
func calcPostage(from: String, to: String) -> Int {
return 42 // good enough until tests tell us otherwise
}
}
struct Context {

Keybase proof

I hereby claim:

  • I am randomstep on github.
  • I am Step (https://keybase.io/Step) on keybase.
  • I have a public key whose fingerprint is C8BE 975A E593 CEDC 55F2 D426 52A1 AFF3 4C0A F28A

To claim this, I am signing this object: