0

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

4

1 回答 1

0

我不认为传递数据是一个问题。但是,为什么不将您的钥匙串代码封装在一个单独的钥匙串包装类中呢?您可以从 B 调用该类以保存用户名和密码,然后从 A 再次调用以读取用户名和密码。然后 A 和 B 永远不需要在它们之间直接传递数据。

于 2014-01-24T07:35:24.287 回答