Reputation: 7022
Im using Crashlytics for crash management. I recently got this crash and I am trying to understand why this crash may have occurred.
Here is my UITableView+ReloadTransition.m
:
#import "UITableView+ReloadTransition.h"
@implementation UITableView (ReloadTransition)
- (void)reloadDataWithFade:(BOOL)animated {
[UIView animateWithDuration:0.3 animations:^{
self.alpha=0.0;
} completion:^(BOOL finished) {
[self reloadData];//line 17
[UIView animateWithDuration:0.2 animations:^{
self.alpha=1.0;
}];
}];
}
Any help is greatly advised? Im kind of a newbie when it comes to crash reports.
Update to include more information.
Upvotes: 2
Views: 183
Reputation: 146
Try swizzling methods. This way i am fading table view on reloading, hope this help you.
@implementation UITableView (Animation)
+(void)load
{
Method original, swizzle;
original = class_getInstanceMethod(self, @selector(reloadData));
swizzle = class_getInstanceMethod(self, @selector(swizzled_reloadData));
method_exchangeImplementations(original, swizzle);
}
-(void)swizzled_reloadData
{
[self swizzled_reloadData];
CATransition *transition = [CATransition animation];
transition.type = kCATransitionFromBottom;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.fillMode = kCAFillModeBackwards;
transition.duration = 0.55;
transition.subtype = kCATransitionFade;
[[self layer] addAnimation:transition forKey:@"UITableViewReloadDataAnimationKey"];
}
@end
Upvotes: 1