Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Saving information in the iOS keychain with swift

How can I save information within the keychain with swift?

What I am trying to do is keep the user always logged in until they tap a "log out" button.

In addition, is it possible to store a random string on the device to act for licensing purposes

ie. the person can only login on one device at a time, so the random string will be sent to the server and stored in an sql database so that other devices can not log in because their key doesn't match the random string generated on the other device.

The app already connects via JSON to my server using a POST method, but I need to store the login information on the device, so I can call it on app open to be rechecked with the server along with their "secret key"