 	var selected: BGStateable?
 	var cachedStates: [BGStateable] = []
 	var folded = false
+	var animationDuration = 1.0
 
 	public override init(frame: CGRect) {
 		super.init(frame: frame)

				self.addSubview(button)
			}
		}
	}

	func buttonFromState(state: BGStateable) -> BGStateView {


		// update
		self.folded = !folded

		// refresh view
		self.reloadViews()
	}

	func reloadViews() {
		UIView.animateWithDuration(animationDuration) {
			self.subviews.forEach {
				$0.hidden = self.folded
			}
		}
	}
}
