Skip to content

Instantly share code, notes, and snippets.

View eytanschulman's full-sized avatar

Eytan Schulman eytanschulman

View GitHub Profile
-(void)changeButtonBackgroundWithAnimation:(UIButton *)button andBackground:(UIImage *)background withDuration:(CFTimeInterval)aduration {
[button setImage:background forState:UIControlStateNormal];
CATransition *transition = [CATransition animation];
transition.duration = aduration;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[button.layer addAnimation:transition forKey:nil];
}

Keybase proof

I hereby claim:

  • I am zorcan1 on github.
  • I am zorcan1 (https://keybase.io/zorcan1) on keybase.
  • I have a public key whose fingerprint is CDFF 46D8 4926 8D4F 13A7 F576 F201 1E21 02F3 E2BE

To claim this, I am signing this object:

@eytanschulman
eytanschulman / iOS Crash
Created February 24, 2014 07:28
This is the crash I get in my output when I tap on a button that launches a UIActionSheet
2014-02-24 09:25:10.553 Staff Manager[403:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Sheet can not be presented because the view is not in a window: <UIView: 0x18a497c0; frame = (0 0; 320 568); autoresize = RM+BM; layer = <CALayer: 0x18a4a430>>'
Basically heres the situation: I have a menu controller using REFrostedViewController(can be found here: https://github.com/romaonthego/REFrostedViewController). The menu controller is working perfectly for everything but this, I tap on a cell in my menu, it dismisses the menu to goto the view it is on already and to call an action sheet, this is what happens.
Here is my code to call the action sheet:
reportssheet = [[UIActionSheet alloc] initWithTitle:@"Choose Your Report" delegate:self cancelButtonTitle:@"Canel" destructiveButtonTitle:nil otherButtonTitles:@"Class List",@"Grade (Student)",@"Attendance Total (Student)",@"Assignment Grade (Class)",@"Assignment Grade (Student)", @"Assignments Given (Class)",@"Weighted
@eytanschulman
eytanschulman / gist:8521776
Created January 20, 2014 15:20
How to make UIActivityViewController not lag
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self presentViewController:activityVC animated:YES completion:^{
}];
}];