]> git.saurik.com Git - cydia.git/blame - UICaboodle/RVPage.mm
Compile Cydia version into Binary: don't lookup with APT.
[cydia.git] / UICaboodle / RVPage.mm
CommitLineData
7e9a36b6
JF
1#import "RVPage.h"
2
3#import <Foundation/Foundation.h>
facbc56d 4#import <UIKit/UIKit.h>
7e9a36b6
JF
5
6#import "RVBook.h"
7
f333f6c5
JF
8extern bool IsWildcat_;
9
35f0a3b5
GP
10@implementation UIViewController (Cydia)
11
12- (BOOL) hasLoaded {
13 return YES;
14}
15
16@end
17
9b623dac 18@implementation CYViewController
fe8e721f 19
27afbbfc 20- (void) setDelegate:(id)delegate {
bc11cf5b 21 delegate_ = delegate;
7e9a36b6 22}
fe8e721f 23
35f0a3b5
GP
24- (id) delegate {
25 return delegate_;
26}
27
fe8e721f
GP
28- (void) viewWillAppear:(BOOL)animated {
29 [super viewWillAppear:animated];
30
77dce1f7
GP
31 // Load on first appearance. We don't need to set the loaded flag here
32 // because it is set for us the first time -reloadData is called.
35f0a3b5 33 if (![self hasLoaded])
fe8e721f
GP
34 [self reloadData];
35}
36
35f0a3b5
GP
37- (BOOL) hasLoaded {
38 return loaded_;
39}
40
fe8e721f
GP
41- (void) releaseSubviews {
42 // Do nothing.
43}
44
45- (void) setView:(UIView *)view {
77dce1f7
GP
46 // Nasty hack for 2.x-compatibility. In 3.0+, we can and
47 // should just override -viewDidUnload instead.
fe8e721f
GP
48 if (view == nil)
49 [self releaseSubviews];
50
51 [super setView:view];
52}
53
7e9a36b6 54- (void) reloadData {
77dce1f7
GP
55 // This is called automatically on the first appearance of a controller,
56 // or any other time it needs to reload the information shown. However (!),
57 // this is not called by any tab bar or navigation controller's -reloadData
58 // method unless this controller returns YES from -hadLoaded.
fe8e721f 59 loaded_ = YES;
7e9a36b6 60}
fe8e721f
GP
61
62- (NSURL *) navigationURL {
63 return nil;
7e9a36b6 64}
fe8e721f 65
27afbbfc 66- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation {
f333f6c5 67 return IsWildcat_ || orientation == UIInterfaceOrientationPortrait;
d817e4de 68}
fe8e721f 69
d817e4de 70@end