How to creat customer class in Swift
Hi Guy
I am very new t mobile app dev. I have experience in C++,C# but absolutely 0 in Mobile app. The app I am working on, is ready and working in Desktop C# and now I am going to take it to mobile.
To start with, I am trying to achieve the following but I really dont know how to do it.
For simplicity let's say I have class called Person
class Person{
string Firstname,LastName;
Person(){}
Person(string fName,string lName)
{
FirstName=fName;
LastName=lName;
}
string GetNames()
{
return Firstname+","+LastName
}
}
Now in my Storyoard, let's define two textfileds
@IBOutlet weak var txtLastName : UITextField
@IBOutlet weak var txtFirstName: UITextField
@IBOutlet weak var lblResult: UILabel
All I need to to to create a Person object like:
Person p = new Person(txtLastName.text,txtFirstName.text)
lblResult.text = p.GetNames()
How this is possible?
Thank you
iPhone 6s, iOS 9.1