]>
Commit | Line | Data |
---|---|---|
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 |
8 | extern bool IsWildcat_; |
9 | ||
35f0a3b5 GP |
10 | @implementation UIViewController (Cydia) |
11 | ||
12 | - (BOOL) hasLoaded { | |
13 | return YES; | |
14 | } | |
15 | ||
15f0d613 JF |
16 | - (void) reloadData { |
17 | } | |
18 | ||
19 | - (void) unloadData { | |
20 | } | |
21 | ||
35f0a3b5 GP |
22 | @end |
23 | ||
9b623dac | 24 | @implementation CYViewController |
fe8e721f | 25 | |
27afbbfc | 26 | - (void) setDelegate:(id)delegate { |
bc11cf5b | 27 | delegate_ = delegate; |
7e9a36b6 | 28 | } |
fe8e721f | 29 | |
35f0a3b5 GP |
30 | - (id) delegate { |
31 | return delegate_; | |
32 | } | |
33 | ||
fe8e721f GP |
34 | - (void) viewWillAppear:(BOOL)animated { |
35 | [super viewWillAppear:animated]; | |
36 | ||
77dce1f7 GP |
37 | // Load on first appearance. We don't need to set the loaded flag here |
38 | // because it is set for us the first time -reloadData is called. | |
35f0a3b5 | 39 | if (![self hasLoaded]) |
fe8e721f GP |
40 | [self reloadData]; |
41 | } | |
42 | ||
35f0a3b5 GP |
43 | - (BOOL) hasLoaded { |
44 | return loaded_; | |
45 | } | |
46 | ||
fe8e721f GP |
47 | - (void) releaseSubviews { |
48 | // Do nothing. | |
49 | } | |
50 | ||
51 | - (void) setView:(UIView *)view { | |
77dce1f7 GP |
52 | // Nasty hack for 2.x-compatibility. In 3.0+, we can and |
53 | // should just override -viewDidUnload instead. | |
fe8e721f GP |
54 | if (view == nil) |
55 | [self releaseSubviews]; | |
56 | ||
57 | [super setView:view]; | |
58 | } | |
59 | ||
7e9a36b6 | 60 | - (void) reloadData { |
15f0d613 JF |
61 | [super reloadData]; |
62 | ||
77dce1f7 GP |
63 | // This is called automatically on the first appearance of a controller, |
64 | // or any other time it needs to reload the information shown. However (!), | |
65 | // this is not called by any tab bar or navigation controller's -reloadData | |
66 | // method unless this controller returns YES from -hadLoaded. | |
fe8e721f | 67 | loaded_ = YES; |
7e9a36b6 | 68 | } |
fe8e721f | 69 | |
6c0ba3d9 JF |
70 | - (void) unloadData { |
71 | loaded_ = NO; | |
15f0d613 | 72 | [super unloadData]; |
6c0ba3d9 JF |
73 | } |
74 | ||
fe8e721f GP |
75 | - (NSURL *) navigationURL { |
76 | return nil; | |
7e9a36b6 | 77 | } |
fe8e721f | 78 | |
27afbbfc | 79 | - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { |
f333f6c5 | 80 | return IsWildcat_ || orientation == UIInterfaceOrientationPortrait; |
d817e4de | 81 | } |
fe8e721f | 82 | |
d817e4de | 83 | @end |