forked from rpetrich/Cask
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Tweak.x
40 lines (35 loc) · 882 Bytes
/
Tweak.x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "generated-headers/Cask-Swift.h"
#import <CoreGraphics/CGGeometry.h>
BOOL hasMovedToWindow = NO;
%hook UIScrollView
-(BOOL)isDragging {
BOOL const orig = %orig;
hasMovedToWindow = !orig;
return orig;
}
-(void)_scrollViewWillBeginDragging {
hasMovedToWindow = NO;
return %orig;
}
-(id)initWithFrame:(CGRect)arg1 {
hasMovedToWindow = YES;
return %orig;
}
%end
%hook UITableView
-(void)reloadData {
hasMovedToWindow = YES;
%orig;
}
- (UITableViewCell *)_createPreparedCellForGlobalRow:(NSInteger)globalRow withIndexPath:(NSIndexPath *)indexPath willDisplay:(BOOL)willDisplay
{
UITableViewCell *result = %orig;
return [Cask animatedTable:result hasMovedToWindow:hasMovedToWindow];
}
%end
%ctor{
if ([[[[NSProcessInfo processInfo] arguments] objectAtIndex:0] containsString:@"/Application"]) {
[Cask loadPrefs];
%init;
}
}