Created
November 21, 2013 17:12
-
-
Save psobko/7585681 to your computer and use it in GitHub Desktop.
From Cheddar iOS app
This file contains hidden or 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
| - (void)setEditing:(BOOL)editing animated:(BOOL)animated { | |
| _editing = editing; | |
| self.textField.enabled = !_editing; | |
| void (^change)(void) = ^{ | |
| _textField.alpha = _editing ? 0.0f : 1.0f; | |
| _renameListButton.alpha = _editing ? 1.0f : 0.0f; | |
| if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
| if (self.frame.size.width < 500.0f) { | |
| _archiveTasksButton.alpha = _renameListButton.alpha; | |
| _archiveAllTasksButton.alpha = 0.0f; | |
| _archiveCompletedTasksButton.alpha = 0.0f; | |
| } else { | |
| _archiveTasksButton.alpha = 0.0f; | |
| _archiveAllTasksButton.alpha = _renameListButton.alpha; | |
| _archiveCompletedTasksButton.alpha = _renameListButton.alpha; | |
| } | |
| } else { | |
| _archiveTasksButton.alpha = _renameListButton.alpha; | |
| } | |
| }; | |
| if (animated) { | |
| [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction animations:change completion:nil]; | |
| } else { | |
| change(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment