Question

I have a modal view controller (B) that is presented by main view controller (A). B has a username and password field and a cancel and save button.

I'm currently using an unwind segue and public properties in B and according IBAction in A to pass data between the VCs. My approach is described here: http://pragmaticstudio.com/blog/2013/2/5/unwind-segues

A then puts the password in the keychain.

As this is sensitive data my question is: Is it safe to pass a password from B to A using public properties or should I handle putting the password in the keychain within B only?

Thanks and kind regards

Was it helpful?

Solution

I don't see that passing the data is an issue. However, why not encapsulate your Keychain code in a separate keychain wrapper class? You could make a call to that class from B to save the username and password, and then another call from A to read the username and password. A and B then never need to pass the data directly between them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top