Skip to content

Instantly share code, notes, and snippets.

@jakemarsh
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save jakemarsh/913c5d55dff53eb17f56 to your computer and use it in GitHub Desktop.

Select an option

Save jakemarsh/913c5d55dff53eb17f56 to your computer and use it in GitHub Desktop.

Revisions

  1. jakemarsh revised this gist May 19, 2015. 3 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
    File renamed without changes.
  2. jakemarsh created this gist May 19, 2015.
    4 changes: 4 additions & 0 deletions chainable-queries.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    Event
    .withCategory(.Meeting)
    .withAttendees([User.me])
    .sort { $0.startDate < $1.startDate }
    16 changes: 16 additions & 0 deletions chainable.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    enum CountdownType: Int { case ToTheSecond, ToTheDay }
    enum ColorScheme: Int { case AfterMidnight, ClassyYellow, Tealfish }

    class Concern {
    var title: String = ""
    func title(aTitle: String?) -> Concern { title = aTitle ?? ""; return self }

    var subtitle = ""
    func subtitle(aSubtitle: String?) -> Concern { subtitle = aSubtitle ?? ""; return self }

    var countdownType: CountdownType = .ToTheSecond
    func countdownType(type: CountdownType) -> Concern { countdownType = type; return self }

    var colorScheme: ColorScheme = .AfterMidnight
    func colorScheme(scheme: ColorScheme) -> Concern { colorScheme = scheme; return self }
    }
    5 changes: 5 additions & 0 deletions composable.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    Concern()
    .title("Big Meeting")
    .subtitle("With those people from that place")
    .countdownType(.ToTheDay)
    .colorScheme(.Tealfish)