]>
Commit | Line | Data |
---|---|---|
ab398adf JF |
1 | #import "ResetView.h" |
2 | ||
3 | #include <objc/objc.h> | |
4 | #include <objc/runtime.h> | |
5 | ||
a9543575 JF |
6 | #include <errno.h> |
7 | ||
8 | #include <cstdio> | |
9 | #include <cstdlib> | |
10 | ||
ab398adf JF |
11 | @implementation UIView (RVBook) |
12 | ||
13 | - (void) resetViewAnimated:(BOOL)animated { | |
14 | fprintf(stderr, "%s\n", class_getName(self->isa)); | |
15 | _assert(false); | |
16 | } | |
17 | ||
18 | - (void) clearView { | |
19 | fprintf(stderr, "%s\n", class_getName(self->isa)); | |
20 | _assert(false); | |
21 | } | |
22 | ||
23 | @end | |
24 | ||
25 | @implementation UITable (RVBook) | |
26 | ||
27 | - (void) resetViewAnimated:(BOOL)animated { | |
28 | [self selectRow:-1 byExtendingSelection:NO withFade:animated]; | |
29 | } | |
30 | ||
31 | - (void) clearView { | |
32 | [self clearAllData]; | |
33 | } | |
34 | ||
35 | @end | |
36 | ||
1fd88570 JF |
37 | @implementation UITableView (RVBook) |
38 | ||
39 | - (void) resetViewAnimated:(BOOL)animated { | |
40 | [self selectRowAtIndexPath:nil animated:animated scrollPosition:UITableViewScrollPositionNone]; | |
41 | } | |
42 | ||
43 | - (void) clearView { | |
44 | //XXX:[[self table] clearView]; | |
45 | } | |
46 | ||
47 | @end | |
48 | ||
ab398adf JF |
49 | @implementation UISectionList (RVBook) |
50 | ||
51 | - (void) resetViewAnimated:(BOOL)animated { | |
52 | [[self table] resetViewAnimated:animated]; | |
53 | } | |
54 | ||
55 | - (void) clearView { | |
56 | [[self table] clearView]; | |
57 | } | |
58 | ||
59 | @end |