             [clojure.data :as data])
   (:require-macros [goby.macros :refer [reify]]))
 
-(def env (atom {}))
-
-(def table-view-scroll-positions {:table-view-scroll-position-none   0
-                                  :table-view-scroll-position-top    1
-                                  :table-view-scroll-position-middle 2
-                                  :table-view-scroll-position-bottom 3})
-
-(def table-view-scroll-positions' (set/map-invert table-view-scroll-positions))
-
-(def table-view-row-animations {:table-view-row-animation-fade      0
-                                :table-view-row-animation-right     1
-                                :table-view-row-animation-left      2
-                                :table-view-row-animation-top       3
-                                :table-view-row-animation-bottom    4
-                                :table-view-row-animation-none      5
-                                :table-view-row-animation-middle    6
-                                :table-view-row-animation-automatic 100})
-
-(def table-view-row-animations' (set/map-invert table-view-row-animations))
-
-(def table-view-cell-accessory-types {:table-view-cell-accessory-none                     0
-                                      :table-view-cell-accessory-disclosure-indicator     1
-                                      :table-view-cell-accessory-detail-disclosure-button 2
-                                      :table-view-cell-accessory-checkmark                3
-                                      :table-view-cell-accessory-detail-button            4})
-
-(def table-view-cell-accessory-types' (set/map-invert table-view-cell-accessory-types))
-
-(def table-view-cell-editing-styles {:table-view-cell-editing-style-none   0
-                                     :table-view-cell-editing-style-delete 1
-                                     :table-view-cell-editing-style-insert 2})
-
-(def table-view-cell-editing-styles' (set/map-invert table-view-cell-editing-styles))
-
-(def device-orientations {:device-orientation-unknown              0
-                          :device-orientation-portrait             1
-                          :device-orientation-portrait-upside-down 2
-                          :device-orientation-landscape-left       3
-                          :device-orientation-landscape-right      4
-                          :device-orientation-face-up              5
-                          :device-orientation-face-down            6})
-
-(def device-orientations' (set/map-invert device-orientations))
-
-(def interface-orientations {:interface-orientation-portrait             (:device-orientation-portrait device-orientations)
-                             :interface-orientation-portrait-upside-down (:device-orientation-portrait-upside-down device-orientations)
-                             :interface-orientation-landscape-left       (:device-orientation-landscape-left device-orientations)
-                             :interface-orientation-landscape-right      (:device-orientation-landscape-right device-orientations)})
-
-(def interface-orientations' (set/map-invert interface-orientations))
-
-(def ^:private ui-control-events {:touch-down              (bit-shift-left 1 0)
-                                  :touch-down-repeat       (bit-shift-left 1 1)
-                                  :touch-drag-inside       (bit-shift-left 1 2)
-                                  :touch-drag-outside      (bit-shift-left 1 3)
-                                  :touch-drag-enter        (bit-shift-left 1 4)
-                                  :touch-drag-exit         (bit-shift-left 1 5)
-                                  :touch-up-inside         (bit-shift-left 1 6)
-                                  :touch-up-outside        (bit-shift-left 1 7)
-                                  :touch-cancel            (bit-shift-left 1 8)
-                                  :value-changed           (bit-shift-left 1 12)
-                                  :editing-did-begin       (bit-shift-left 1 16)
-                                  :editing-changed         (bit-shift-left 1 17)
-                                  :editing-did-end         (bit-shift-left 1 18)
-                                  :editing-did-end-on-exit (bit-shift-left 1 19)})
-
-(def ^:private inverted-ui-control-events (set/map-invert ui-control-events))
-
-(def ^:private attributes {:not-applicable 0
-                           :enabled        1
-                           :text           2
-                           :selected       3
-                           :highlighted    4
-                           :hidden         5})
-
-(def ^:private inverted-attributes (set/map-invert attributes))
+(def env "Contains a map of environment values such as whether running a release build, etc." (atom {}))
+
+
+(def table-view-scroll-positions
+  "Defines a map from keywords to `UITableViewScrollPosition` values."
+  {:table-view-scroll-position-none   0
+   :table-view-scroll-position-top    1
+   :table-view-scroll-position-middle 2
+   :table-view-scroll-position-bottom 3})
+
+(def table-view-scroll-positions'
+  "Defines a map from `UITableViewScrollPosition` values to keywords."
+  (set/map-invert table-view-scroll-positions))
+
+(def table-view-row-animations
+  "Defines a map from keywords to `UITableViewRowAnimation` values."
+  {:table-view-row-animation-fade      0
+   :table-view-row-animation-right     1
+   :table-view-row-animation-left      2
+   :table-view-row-animation-top       3
+   :table-view-row-animation-bottom    4
+   :table-view-row-animation-none      5
+   :table-view-row-animation-middle    6
+   :table-view-row-animation-automatic 100})
+
+(def table-view-row-animations'
+  "Defines a map from `UITableViewRowAnimation` values to keywords."
+  (set/map-invert table-view-row-animations))
+
+(def table-view-cell-accessory-types
+  "Defines a map from keywords to `UITableViewAccesoryType` values."
+  {:table-view-cell-accessory-none                     0
+   :table-view-cell-accessory-disclosure-indicator     1
+   :table-view-cell-accessory-detail-disclosure-button 2
+   :table-view-cell-accessory-checkmark                3
+   :table-view-cell-accessory-detail-button            4})
+
+(def table-view-cell-accessory-types'
+  "Defines a map from `UITableViewAccesoryType` values to keywords."
+  (set/map-invert table-view-cell-accessory-types))
+
+(def table-view-cell-editing-styles
+  "Defines a map from keywords to `UITableViewEditingStyle` values."
+  {:table-view-cell-editing-style-none   0
+   :table-view-cell-editing-style-delete 1
+   :table-view-cell-editing-style-insert 2})
+
+(def table-view-cell-editing-styles'
+  "Defines a map from `UITableViewEditingStyle` values to keywords."
+  (set/map-invert table-view-cell-editing-styles))
+
+(def device-orientations
+  "Defines a map from keywords to `UIDeviceOrientation` values."
+  {:device-orientation-unknown              0
+   :device-orientation-portrait             1
+   :device-orientation-portrait-upside-down 2
+   :device-orientation-landscape-left       3
+   :device-orientation-landscape-right      4
+   :device-orientation-face-up              5
+   :device-orientation-face-down            6})
+
+(def device-orientations'
+  "Defines a map from `UIDeviceOrientation` values to keywords."
+  (set/map-invert device-orientations))
+
+(def interface-orientations
+  "Defines a map from keywords to `UIInterfaceOrientation` values."
+  {:interface-orientation-portrait             (:device-orientation-portrait device-orientations)
+   :interface-orientation-portrait-upside-down (:device-orientation-portrait-upside-down device-orientations)
+   :interface-orientation-landscape-left       (:device-orientation-landscape-left device-orientations)
+   :interface-orientation-landscape-right      (:device-orientation-landscape-right device-orientations)})
+
+(def interface-orientations'
+  "Defines a map from `UIInterfaceOrientation` values to keywords."
+  (set/map-invert interface-orientations))
+
+(def ^:private ui-control-events
+  "Defines a map from keywords to `UIControlEvent` values."
+  {:touch-down              (bit-shift-left 1 0)
+   :touch-down-repeat       (bit-shift-left 1 1)
+   :touch-drag-inside       (bit-shift-left 1 2)
+   :touch-drag-outside      (bit-shift-left 1 3)
+   :touch-drag-enter        (bit-shift-left 1 4)
+   :touch-drag-exit         (bit-shift-left 1 5)
+   :touch-up-inside         (bit-shift-left 1 6)
+   :touch-up-outside        (bit-shift-left 1 7)
+   :touch-cancel            (bit-shift-left 1 8)
+   :value-changed           (bit-shift-left 1 12)
+   :editing-did-begin       (bit-shift-left 1 16)
+   :editing-changed         (bit-shift-left 1 17)
+   :editing-did-end         (bit-shift-left 1 18)
+   :editing-did-end-on-exit (bit-shift-left 1 19)})
+
+(def ^:private inverted-ui-control-events
+  "Defines a map from `UIControlEvent` values to keywords."
+  (set/map-invert ui-control-events))
+
+(def ^:private attributes
+  "Defines a map from keywords to `UIAttribute` values."
+  {:not-applicable 0
+   :enabled        1
+   :text           2
+   :selected       3
+   :highlighted    4
+   :hidden         5})
+
+(def ^:private inverted-attributes
+  "Defines a map from `UIAttribute` values to keywords."
+  (set/map-invert attributes))
 
 (defn- form-events-mask
   [ui-control-events-set]
   (reduce bit-or 0 (map ui-control-events ui-control-events-set)))
 
-(def fetched-results-change-type {:fetched-results-change-insert 1
-                                  :fetched-results-change-delete 2
-                                  :fetched-results-change-move   3
-                                  :fetched-results-change-update 4})
-
-(def fetched-results-change-type' (set/map-invert fetched-results-change-type))
+(def fetched-results-change-type
+  "Defines a map from keywords to `NSFetchedResultsChangeType` values."
+  {:fetched-results-change-insert 1
+   :fetched-results-change-delete 2
+   :fetched-results-change-move   3
+   :fetched-results-change-update 4})
+
+(def fetched-results-change-type'
+  "Defines a map from `NSFetchedResultsChangeType` values to keywords."
+  (set/map-invert fetched-results-change-type))
 
 (defprotocol TableViewDelegate
+  "Defines a protocol consistent with `UITableViewDelegate`."
 
   ;; All methods in this protocol are optional
 

  (^:export perform-action-for-row-at-index-path-with-sender [this sel section row sender]))

(defprotocol TableViewDataSource

  (^:export TableViewDataSource-implements [this])


  (^:export move-row-at-index-path [this source-section source-row destination-section destination-row]))

(defprotocol FetchedResultsControllerDelegate
  "Defines a protocol consistent with `NSFetchedResultsControllerDelegate`."

  (^:export FetchedResultsControllerDelegate-implements [this])

