summaryrefslogtreecommitdiff
path: root/UICaboodle/ResetView.mm
blob: ffdb0431d45f41efc79e7328ac84d8b520e64c0f (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
#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 UITableView (RVBook)

- (void) resetViewAnimated:(BOOL)animated {
    //[self selectRowAtIndexPath:nil animated:animated scrollPosition:UITableViewScrollPositionNone];
    if (NSIndexPath *path = [self indexPathForSelectedRow])
        [self deselectRowAtIndexPath:path animated:animated];
}

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

@end