 	
 	// OTHER METHODS	-----
 	
+	private func selectConnectionState(_ selectedState: ConnectionState, isProcessing: Bool = false)
+	{
+		// Updates labels and selection
+		for (state, index) in availableConnectionStates
+		{
+			if state == selectedState
+			{
+				connectionSegmentedControl.setTitle(isProcessing ? state.processingText : state.ongoingText, forSegmentAt: index)
+				connectionSegmentedControl.selectedSegmentIndex = index
+			}
+			else
+			{
+				connectionSegmentedControl.setTitle(state.actionText, forSegmentAt: index)
+			}
+		}
+	}
+	
 	private func updateStatus()
 	{
 		if let hostSession = P2PHostSession.instance
 		{
-			connectionSegmentedControl.selectedSegmentIndex = 2
+			selectConnectionState(.hosting)
 			
 			// QR view and the QR tag are displayed when there's an active host session
 			if qrView.isHidden, let qrImage = hostSession.connectionInformation?.qrCode?.image

			
			if P2PClientSession.isConnected
			{
				connectionSegmentedControl.selectedSegmentIndex = 1
				onlineStatusView.isHidden = false
			}
			else
			{
				connectionSegmentedControl.selectedSegmentIndex = joining ? 1 : 0
				onlineStatusView.isHidden = true
			}
		}
		

		return QRCodeReaderViewController(builder: builder)
	}()
	
	private var canHost = false
	private var canJoin = false
	
	
	// COMPUTED PROPERTIES	----
	
	private var availableConnectionStates: [(ConnectionState, Int)]
	{
		var states = [(ConnectionState.disconnected, 0)]
		var nextIndex = 1
		
		if canJoin
		{
			states.add((ConnectionState.joined, nextIndex))
			nextIndex += 1
		}
		if canHost
		{
			states.add((ConnectionState.hosting, nextIndex))
			nextIndex += 1
		}
		
		return states
	}
	
	
	// INIT	--------------------
	
