UIViewController option data from segue or NSUserdefault
<p>I have the problem with pass data between controller. In requirement, I have used tab bar, there is root to "search people view" and "profile view". when I click profile view, the data is from my <code>NSUserDefaults</code> data but if I click the people cell from search people view, the profile view should display the data from people cell. I'm confused how to handle that case. Are there possible to identification the segue identifier that in to profile view.
please help, prefer swift code</p>

<p>UPDATE:</p>

<p>this is my code on "search people view":</p>

<pre><code>    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "ShowAlumniAngkatan" {
        if let destination = segue.destinationViewController as? DetailProfile{
            let indexPath = ListAlumniTable.indexPathForSelectedRow
            let data = SearchResult[indexPath!.row]
        }
    }
}
</code></pre>

<p>and below is "Profile view" code :</p>

<pre><code>class ProfileDetailsViewController: UIViewController {


@IBOutlet weak var BackgroundImage: UIImageView!
@IBOutlet weak var ProfileTable: UITableView!
@IBOutlet weak var ProfilePictureImage: UIImageView!

var Profiles:DetailProfile!
var contacts:[Contact] = [Contact]()
var work:[Work] = [Work]()
var advise:String!

var SeeMoreEnbable:Bool!

override func viewDidLoad() {
    super.viewDidLoad()
    InitializationView()
    SeeMoreEnbable = false
    getData()
}



override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}

override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
    self.view.endEditing(true)
}

// MARK - Init View
func InitializationView(){
    blurImage()
    circleImage()
}

func getData(){
    let defaults = NSUserDefaults.standardUserDefaults().objectForKey("UserDetail") as! [NSData]
    self.advise = NSKeyedUnarchiver.unarchiveObjectWithData(defaults[3] as NSData) as! String
    let temp1 =  NSKeyedUnarchiver.unarchiveObjectWithData(defaults[2] as NSData) as! [NSArray]
    for data in temp1{
        let jabatan = NSKeyedUnarchiver.unarchiveObjectWithData(data[0] as! NSData) as! String
        let perusahaan = NSKeyedUnarchiver.unarchiveObjectWithData(data[1] as! NSData) as! String
        let tahunkerja = NSKeyedUnarchiver.unarchiveObjectWithData(data[2] as! NSData) as! String
        self.work.append(Work(Jabatan: jabatan, Perusahaan: perusahaan, TahunKerja: tahunkerja))
        print(work[0].Jabatan)
        print(work.count)

    }
    let temp2 =  NSKeyedUnarchiver.unarchiveObjectWithData(defaults[1] as NSData) as! [NSArray]
    for data in temp2{
        let Type = NSKeyedUnarchiver.unarchiveObjectWithData(data[0] as! NSData) as! String
        let Detail = NSKeyedUnarchiver.unarchiveObjectWithData(data[1] as! NSData) as! String
        self.contacts.append(Contact(ContactType: Type, ContactDetail: Detail))
    }
}
</code></pre>

<p>}</p>

<p>I have implemented <code>prepareForSegue</code> on search people view that should send the data from row that selected. But I don't have idea about choose data from segue or from <code>NSUserDefaults</code>. </p>