Skip to content
This repository was archived by the owner on Jun 19, 2019. It is now read-only.

Conversation

@interstateone
Copy link
Contributor

This is some much-needed cleaning up and separation of how Jeff interacts with Dropbox.

The goals are to have less management code in the recordings VC and moved into proper controllers and model code. I'm anticipating the implementation of some of the Dropbox interaction changing further (see bottom). This is a step in that direction. This PR does incidentally fix the flickering table view issue.

I've structured this change like so: I treat the VC as part of the view layer, and now I have a facade controller it interacts with that owns a file repository and a file uploader. The file repository handles interacting with the file system. The file uploader handles uploading files, their progress and fetching public links for files. This separation is pretty blurry when using a service like Dropbox, but I think this should be a reasonable separation for using other services too, like, say, filesystem + Imgur. Regardless, it provides a reasonable level of code in each class. There are protocols for both of these classes that I try to think of first (instead of thinking of the classes themselves) as I find that better represents how those objects should communicate.

I also made a change that manipulates the list of recordings by placing them in a sorted index instead of inserting and then sorting the entire array. This was the cause of the aformentioned UI flickering as the table view tried to keep up.

In the future I'd like to:

  • Remove the requirement to have files open for longer than they need to be. This isn't generally difficult, but Dropbox might have some edge cases like if a file isn't fully downloaded or cached. The biggest change would be during the upload phase.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why one NSObject * and one id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to call a KVO method at L43 but it's an informal protocol. I'll add a comment!

@crayment
Copy link

Tests pass and behaviour seems great in my testing :)

@interstateone
Copy link
Contributor Author

@crayment Thanks for taking the time to look at this! Fixed your comments.

@crayment
Copy link

Looks good 👍

interstateone added a commit that referenced this pull request Nov 14, 2014
@interstateone interstateone merged commit 08a4dba into 1.0.1 Nov 14, 2014
@interstateone interstateone deleted the RefactorRecordingManagement branch November 14, 2014 06:25
@interstateone interstateone added this to the 1.0.1 milestone Nov 20, 2014
interstateone added a commit that referenced this pull request Sep 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants