summaryrefslogtreecommitdiff
path: root/UICaboodle/ResetView.mm
blob: e0db8315e8b9e345b7b71ca7571089c7af13d6de (plain)
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
41
42
43
44
45
46
47
#import "ResetView.h"

#include <objc/objc.h>
#include <objc/runtime.h>

#include <errno.h>

#include <cstdio>
#include <cstdlib>

@implementation UIView (RVBook)

- (void) resetViewAnimated:(BOOL)animated {
    fprintf(stderr, "%s\n", class_getName(self->isa));
    _assert(false);
}

- (void) clearView {
    fprintf(stderr, "%s\n", class_getName(self->isa));
    _assert(false);
}

@end

@implementation UITable (RVBook)

- (void) resetViewAnimated:(BOOL)animated {
    [self selectRow:-1 byExtendingSelection:NO withFade:animated];
}

- (void) clearView {
    [self clearAllData];
}

@end

@implementation UISectionList (RVBook)

- (void) resetViewAnimated:(BOOL)animated {
    [[self table] resetViewAnimated:animated];
}

- (void) clearView {
    [[self table] clearView];
}

@end