     }
     
     // MARK: - State Restoration
-    
+
+    enum RestorationKeys {
+
+        static let scrollXOffset = "scrollOrigin"
+        static let selectedButtonIndex = "selectedButtonIndex"
+    }
+
     public override func encodeRestorableStateWithCoder(coder: NSCoder) {
         super.encodeRestorableStateWithCoder(coder)
         

        }
    }
}

let kScrollXOffsetKey = "scrollOrigin"
let kSelectedButtonIndexKey = "selectedButtonIndex"

            }
        }

        coder.encodeDouble(scrollXOffset, forKey: RestorationKeys.scrollXOffset)
        coder.encodeInteger(selectedButtonIndex, forKey: RestorationKeys.selectedButtonIndex)
    }

    public override func restoreStateWithCoder(coder: NSCoder) {
        super.restoreStateWithCoder(coder)
        
        let scrollXOffset = coder.decodeDoubleForKey(RestorationKeys.scrollXOffset)
        let selectedButtonIndex = coder.decodeIntegerForKey(RestorationKeys.selectedButtonIndex)
        
        var bounds = self.scrollView!.contentView.bounds
        bounds.origin.x = CGFloat(scrollXOffset)
