I\'m parsing data with json, and i want to pass model_id to ActiveSubViewController / id_model. What am i doing wrong?
// ViewController.swift
//
// Copyright
Do make a separate property var model_id : String = "" in the starting of your class and then use the prepare
function outside your LoginBtnTapped
function :
Here it is :
// ViewController.swift
//
// Copyright © 2017 smokzz. All rights reserved.
//
import UIKit
import SwiftMessages
import Alamofire
class ViewController: UIViewController,UIAlertViewDelegate {
@IBOutlet var myTableView: UIView!
@IBOutlet weak var EmailField: UITextField!
@IBOutlet weak var PasswordField: UITextField!
var model_id : String = ""
@IBAction func LoginBtnTapped(_ sender: Any) {
let userEmail = EmailField.text!
let userPassword = PasswordField.text!
if((userEmail.isEmpty) || (userPassword.isEmpty)){
// createAlert(title: "Oops! ", message: "Email or Password field is empty")
let view = MessageView.viewFromNib(layout: .CardView)
view.configureTheme(.error)
view.configureDropShadow()
let iconText = ["