Skip to content
Sora2455 edited this page Apr 30, 2015 · 3 revisions

The database functions can be found in databaseComms.swift. There are currently seven functions that can be used to interact with the database present. All seven are currently untested.

Sign up

This function takes a username, password and email address, and adds them as a user

Log in

Logs the user in with the same username and password. Either this function or the sign in function must have been called before the database can really be used.

Create new exercise

This function takes the name of the exercise as a string and three integers for the length of the exercise, the length of the rest periods, and the number of sets. The exercise is stored in a local database, so internet access is not required.

Retrieve exercise

This function currently just takes PFObject of the current user and returns the first exercise registered to them. The ability to iterate though the others is in progress.

Edit exercise

Given an existing exercise, and the same string and three integers from the creation function, this function will edit said exercise.

Log exercise

This function will create a record that a given user completed a given exercise on a certain time.

View log

This function will return the first recorded log for a user/exercise pair if it exists. Further functionality in progress.

Clone this wiki locally