1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | #import "CDVInAppBrowserNavigationController.h"
|
21 |
|
22 | @implementation CDVInAppBrowserNavigationController : UINavigationController
|
23 |
|
24 | - (void) dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {
|
25 | if ( self.presentedViewController) {
|
26 | [super dismissViewControllerAnimated:flag completion:completion];
|
27 | }
|
28 | }
|
29 |
|
30 | - (void) viewDidLoad {
|
31 | [super viewDidLoad];
|
32 | }
|
33 |
|
34 | - (CGRect) invertFrameIfNeeded:(CGRect)rect {
|
35 | if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
|
36 | CGFloat temp = rect.size.width;
|
37 | rect.size.width = rect.size.height;
|
38 | rect.size.height = temp;
|
39 | }
|
40 | rect.origin = CGPointZero;
|
41 | return rect;
|
42 | }
|
43 |
|
44 | #pragma mark CDVScreenOrientationDelegate
|
45 |
|
46 | - (BOOL)shouldAutorotate
|
47 | {
|
48 | if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) {
|
49 | return [self.orientationDelegate shouldAutorotate];
|
50 | }
|
51 | return YES;
|
52 | }
|
53 |
|
54 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
55 | {
|
56 | if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
|
57 | return [self.orientationDelegate supportedInterfaceOrientations];
|
58 | }
|
59 |
|
60 | return 1 << UIInterfaceOrientationPortrait;
|
61 | }
|
62 |
|
63 | @end
|