Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wednesday lab #3

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Wednesday lab #3

wants to merge 33 commits into from

Conversation

robert-hatfield
Copy link
Owner

@robert-hatfield robert-hatfield commented May 11, 2017

Lab Assignment

  • When saving new Todo objects on Firebase, add the currentUser's email to each Todo.
    • Note: I opted to store the user's email address as a property of the currentUser on Firebase, which was given as an alternate solution in lecture. I feel this is much cleaner and keeps this property coupled to the user reference, rather than to each Todo object.
  • Implement fetching Todos from Firebase in your TVOS application.
  • When your TVOS application first launches, before loading Todos into the tableView, you should prompt the user for their email, and populate the UITableView with only their associated Todos.
    • Be creative with the UX for this.
  • When returning to the main thread, use GCD for your operations instead of NSOperationQueue.

Incomplete... I'm not doing anything with the results yet.
We're using a placeholder array of data until we can get data from Firebase on the TV and Watch platforms.
This is initially assigned as an NSNumber of zero when new todos are created and sent to Firebase.
On retrieval, the NSNumber is cast into the Boolean equivalent for readability in client-side code.
The destination view controller receives a Todo object, and uses it to define it's own title.
I moved logic for Firebase and a "database" of todos into a singleton
 class. Using NSNotifications to advise observing views of changes to
 the data.
This view controller subscribes to NSNotifications from the singleton TodoDatabase.
Note that there is currently no user authorization since Firebase Auth doesn't currently support tvOS.
I also removed the NSNotification center property, since it's not needed elsewhere in the class.
This isn't an ideal UX, but the functionality is there. I'd like to
 present a subview with editing options instead. Quite a bit of work
 to this end was done on an experimental branch, but I couldn't get it
 working tonight.
Crashes when attempting to validate user email. The dictionary object
 for each user is being interpreted or cast as a string object somehow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant