Skip to content

Instantly share code, notes, and snippets.

@jeffstieler
Created September 24, 2009 20:01
Show Gist options
  • Save jeffstieler/193008 to your computer and use it in GitHub Desktop.
Save jeffstieler/193008 to your computer and use it in GitHub Desktop.
Ideas for adding undo to Movement:
Create AppController :: setAppLocations:(NSArray *) something like:
- (void)setAppLocations:(NSArray *)appLocations
{
for each array in appLocations:
clear app screen
get each iphone app from allAppsOnDevice using id
set this screen controller's apps to above created array
screen controller reload data / view refresh
}
In iPhoneController :: processApps:forRow:ofScreen:
If an app identifier containing a hyphen is found, once we find the
actual represented app, add it back to the allAppsOnDevice dictionary, so
that it can be looked up later without the overhead.
In AppScreenController :: performDragOperation:
Before calling the move apps method of AppController, take a "snapshot"
of all the app screens. Store each app identifer in order for each
screen, and build an undo manager call to setAppLocations: for action
"Undo Move Apps"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment