Created
April 12, 2011 03:19
-
-
Save veader/914853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using an animation grouping because we may be changing the duration | |
[NSAnimationContext beginGrouping]; | |
// With the shift key down, do slow-mo animation | |
if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) { | |
[[NSAnimationContext currentContext] setDuration:1.0]; | |
} else { | |
[[NSAnimationContext currentContext] setDuration:0.6]; | |
} | |
NSRect originalFrame; | |
NSRect finalFrame; | |
// set final frame (ie: move to left by width) | |
originalFrame = _mainFeedViewController.view.frame; | |
finalFrame = originalFrame; | |
finalFrame.origin.x += originalFrame.size.width; | |
[_mainFeedViewController.view.animator setFrame:finalFrame]; | |
originalFrame = _detailViewController.view.frame; | |
finalFrame = originalFrame; | |
finalFrame.origin.x += originalFrame.size.width; | |
[_detailViewController.view.animator setFrame:finalFrame]; | |
[NSAnimationContext endGrouping]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment