Sobes.tech
Junior — Senior

Create a subscription mechanism

livecode

Task condition

Describe how you would design an API that, when a button is pressed, retrieves the user-entered data from a UITextField and sends it in a network request.

class ViewController: UIViewController {
    @IBOutlet private var usernameField: UITextField!
    @IBOutlet private var pwdField: UITextField!
    @IBOutlet private var loginButton: UIButton!

    override func viewDidLoad() {
        super.viewDidLoad()
        // ?
    }

    private func signInUser(login: String, password: String) -> Single<Void> {
        // network request
    }
}