func setupViewComponents()

in IoT-Sample/Swift/IoTSampleSwift/ConnectionViewController.swift [304:338]


    func setupViewComponents() {
        let labelHeight = 44 * 4
        
        let buttonWidth = 300
        let buttonHeight = 44
        let spacer = 10
        let x = 44
        var y = 100
        
        connectIoTDataWebSocket = UIButton(frame: CGRect(x: x, y: y, width: buttonWidth, height: buttonHeight))
        connectIoTDataWebSocket.setTitle("Connect \(self.IOT_WEBSOCKET)", for: .normal)
        connectIoTDataWebSocket.tintColor = .black
        connectIoTDataWebSocket.backgroundColor = .lightGray

        y += spacer + buttonHeight
        
        connectButton = UIButton(frame: CGRect(x: x, y: y, width: buttonWidth, height: buttonHeight))
        connectButton.setTitle("Connect \(self.IOT_CERT)", for: .normal)
        connectButton.tintColor = .black
        connectButton.backgroundColor = .lightGray

        y += spacer + buttonHeight
        logTextView = UITextView(frame: CGRect(x: 5, y: y, width: 300, height: labelHeight))
        y += spacer + labelHeight
        activityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: x, y: y, width: 44, height: 44))
        
        connectIoTDataWebSocket.addTarget(self, action: #selector(didTapConnectIoTDataWebSocket(_:)), for: .touchUpInside)
        connectButton.addTarget(self, action: #selector(connectButtonPressed(_:)), for: .touchUpInside)
        
        self.view.addSubview(connectIoTDataWebSocket)
        self.view.addSubview(connectButton)

        self.view.addSubview(logTextView)
        self.view.addSubview(activityIndicatorView)
    }