		}))
		return action
	}

	func connectChoice<T>(choices: [T], description: (T) -> String = { String(describing: $0) }) -> Observable<T?> {
		let action = PublishSubject<T?>()

		let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: { _ in action.onSuccess(nil) })

		let actions = choices.map { element in
			UIAlertAction(title: description(element), style: .default, handler: { _ in action.onSuccess(element) })