├── .gitignore
├── screen
└── screen.gif
├── ChirdVCRotateDemo
├── Assets.xcassets
│ ├── Contents.json
│ ├── IMG_1271.imageset
│ │ ├── IMG_1271.jpg
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── NavViewController.h
├── TableViewController.h
├── ViewController.h
├── DetailViewController.h
├── AppDelegate.h
├── main.m
├── NavViewController.m
├── Info.plist
├── Base.lproj
│ └── LaunchScreen.storyboard
├── ViewController.m
├── AppDelegate.m
├── DetailViewController.m
└── TableViewController.m
├── ChirdVCRotateDemo.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── mrlu.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── ChirdVCRotateDemo.xcscheme
└── project.pbxproj
├── PlayerContainerViewController
└── class
│ ├── PlayerLandscapeViewController.h
│ ├── PlayerLandscapeViewController.m
│ ├── PlayerContainerViewController.h
│ └── PlayerContainerViewController.m
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ChirdVCRotateDemo.xcodeproj/xcuserdata/mrlu.xcuserdatad/xcdebugger
2 |
--------------------------------------------------------------------------------
/screen/screen.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrLu/ChirdVCRotateDemo/HEAD/screen/screen.gif
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Assets.xcassets/IMG_1271.imageset/IMG_1271.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrLu/ChirdVCRotateDemo/HEAD/ChirdVCRotateDemo/Assets.xcassets/IMG_1271.imageset/IMG_1271.jpg
--------------------------------------------------------------------------------
/ChirdVCRotateDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/NavViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // NavViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NavViewController : UINavigationController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/TableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 01/03/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TableViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/DetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DetailViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/PlayerContainerViewController/class/PlayerLandscapeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PlayerLandscapeViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface PlayerLandscapeViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Assets.xcassets/IMG_1271.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "IMG_1271.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/NavViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // NavViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "NavViewController.h"
10 |
11 | @implementation NavViewController
12 |
13 | - (BOOL)shouldAutorotate
14 | {
15 | return [self.viewControllers.lastObject shouldAutorotate];
16 | }
17 |
18 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
19 | {
20 | return [self.viewControllers.lastObject supportedInterfaceOrientations];
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo.xcodeproj/xcuserdata/mrlu.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ChirdVCRotateDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 085F4B2B1E6488DC00140920
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/PlayerContainerViewController/class/PlayerLandscapeViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // PlayerLandscapeViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "PlayerLandscapeViewController.h"
10 |
11 | @interface PlayerLandscapeViewController ()
12 |
13 | @end
14 |
15 | @implementation PlayerLandscapeViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | - (void)didReceiveMemoryWarning {
23 | [super didReceiveMemoryWarning];
24 | // Dispose of any resources that can be recreated.
25 | }
26 |
27 | - (BOOL)shouldAutorotate
28 | {
29 | return YES;
30 | }
31 |
32 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
33 | {
34 | return UIInterfaceOrientationMaskLandscape;
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PlayerContainerViewController
2 |
3 | [](https://developer.apple.com/iphone/index.action)
5 | [](https://developer.apple.com/Objective-C)
6 | [](http://mit-license.org)
7 |
8 | > 主流视频App 视频页面切换效果实现DEMO
9 | >参照腾讯、爱奇艺、搜狐视频、头条等视频展示效果
10 |
11 | ##截图
12 | 
13 |
14 | ##使用:
15 | ###示例代码
16 | ```
17 | //大小屏切换
18 | self.playerContainerVC = [[PlayerContainerViewController alloc] initWithView:self.movieView viewController:self];
19 | self.playerContainerVC.view.backgroundColor = [UIColor blackColor];
20 | [self addChildViewController:self.playerContainerVC]; //增加子容器
21 | [self.movieView addSubview:self.playerContainerVC.view];
22 | ```
23 |
24 | ```
25 | //大小屏切换 迷你屏切换 参考demo
26 | ```
27 |
28 | ###原理
29 | 1、 大小屏切换利用present VC 实现横屏逻辑
30 | 2、 利用UIDevice 主动设置设备方向
31 |
32 | ### by
33 | * 问题建议 to mail
34 | * mail:haozi370198370@gmail.com
35 |
--------------------------------------------------------------------------------
/PlayerContainerViewController/class/PlayerContainerViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PlayerContainerViewController.h
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, PlayerDisplayStyle) {
12 | PlayerDisplayStyleMini, //小屏幕
13 | PlayerDisplayStyleNormal, //正常屏幕
14 | PlayerDisplayStyleFull //大屏幕
15 | };
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | @interface PlayerContainerViewController : UIViewController
20 |
21 | @property (nonatomic, strong, nonnull) UIViewController *portraitViewController;
22 | @property (nonatomic, assign, readonly) PlayerDisplayStyle displayStyle;
23 | @property (nonatomic, assign) BOOL displayMiniEnable;
24 | @property (nonatomic, assign) CGRect displayMiniRect;
25 | @property (nonatomic, assign) CGRect displayNormalRect;
26 |
27 | - (instancetype)initWithViewController:(UIViewController *)viewController;
28 |
29 | - (instancetype)initWithView:(nullable UIView *)view viewController:(UIViewController *)viewController;
30 |
31 | - (void)showDisplayNormalInView:(UIView *)view;
32 |
33 | - (void)showMiniDisplay:(BOOL)ainimated;
34 |
35 | - (void)changePlayerDisplayStyle:(PlayerDisplayStyle)disPlayStyle;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "DetailViewController.h"
11 | #import "TableViewController.h"
12 |
13 | @interface ViewController ()
14 |
15 | @property (nonatomic, strong) UIButton *btn;
16 |
17 | @end
18 |
19 | @implementation ViewController
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 | self.title = @"PlayerViewDemo";
24 |
25 | // Do any additional setup after loading the view, typically from a nib.
26 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
27 | btn.frame = CGRectMake(0, 150, self.view.bounds.size.width, 40);
28 | [btn setTitle:@"详情" forState:UIControlStateNormal];
29 | [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
30 | [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchDown];
31 | [self.view addSubview:btn];
32 |
33 | btn = [UIButton buttonWithType:UIButtonTypeCustom];
34 | btn.frame = CGRectMake(0, 150+40+40, self.view.bounds.size.width, 40);
35 | [btn setTitle:@"列表" forState:UIControlStateNormal];
36 | [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
37 | [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchDown];
38 | [self.view addSubview:btn];
39 | }
40 |
41 | - (void)viewWillAppear:(BOOL)animated {
42 | [super viewWillAppear:animated];
43 | [self.navigationController setNavigationBarHidden:NO];
44 | }
45 |
46 | - (void)didReceiveMemoryWarning {
47 | [super didReceiveMemoryWarning];
48 | // Dispose of any resources that can be recreated.
49 | }
50 |
51 | - (void)btnAction:(UIButton *)sender
52 | {
53 | if([sender.titleLabel.text isEqualToString:@"详情"]) {
54 | UIViewController *vc = [DetailViewController new];
55 | [self.navigationController pushViewController:vc animated:YES];
56 | } else {
57 | TableViewController *vc = [TableViewController new];
58 | [self.navigationController pushViewController:vc animated:YES];
59 | }
60 | }
61 |
62 | - (BOOL)shouldAutorotate
63 | {
64 | return NO;
65 | }
66 |
67 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
68 | {
69 | return UIInterfaceOrientationMaskPortrait;
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 | #import "NavViewController.h"
12 |
13 | @interface AppDelegate ()
14 |
15 | @end
16 |
17 | @implementation AppDelegate
18 |
19 |
20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
21 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
22 | self.window.backgroundColor = [UIColor whiteColor];
23 | self.window.rootViewController = [[NavViewController alloc] initWithRootViewController:[ViewController new]];
24 | [self.window makeKeyAndVisible];
25 | return YES;
26 | }
27 |
28 |
29 | - (void)applicationWillResignActive:(UIApplication *)application {
30 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
31 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
32 | }
33 |
34 |
35 | - (void)applicationDidEnterBackground:(UIApplication *)application {
36 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
38 | }
39 |
40 |
41 | - (void)applicationWillEnterForeground:(UIApplication *)application {
42 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
43 | }
44 |
45 |
46 | - (void)applicationDidBecomeActive:(UIApplication *)application {
47 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
48 | }
49 |
50 |
51 | - (void)applicationWillTerminate:(UIApplication *)application {
52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
53 | }
54 |
55 |
56 | - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
57 | {
58 | return UIInterfaceOrientationMaskAllButUpsideDown;
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/DetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "DetailViewController.h"
10 | #import "PlayerContainerViewController.h"
11 |
12 | @interface DetailViewController ()
13 |
14 | @property (nonatomic, strong) UIImageView *backgroundImageView;
15 | @property (nonatomic, strong) UIView *movieView;
16 |
17 | @property (nonatomic, strong) PlayerContainerViewController *playerContainerVC;
18 |
19 | @end
20 |
21 | @implementation DetailViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | // Do any additional setup after loading the view.
26 | self.navigationController.navigationBarHidden = YES;
27 | self.backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
28 | self.backgroundImageView.contentMode = UIViewContentModeScaleAspectFit;
29 | self.backgroundImageView.image = [UIImage imageNamed:@"IMG_1271.jpg"];
30 | self.backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
31 | [self.view addSubview:self.backgroundImageView];
32 |
33 | CGRect frame = self.view.bounds;
34 | frame.size.height = self.backgroundImageView.image.size.height*self.backgroundImageView.bounds.size.width/self.backgroundImageView.image.size.width;
35 | self.backgroundImageView.frame = frame;
36 |
37 | self.movieView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, 211)];
38 | [self.view addSubview:self.movieView];
39 |
40 | UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeSystem];
41 | [backBtn setFrame:CGRectMake(10, 30, 35, 35)];
42 | [backBtn setTitle:@"Back" forState:UIControlStateNormal];
43 | [backBtn addTarget:self action:@selector(backBtnAction:) forControlEvents:UIControlEventTouchUpInside];
44 | [self.view addSubview:backBtn];
45 |
46 | //
47 | self.playerContainerVC = [[PlayerContainerViewController alloc] initWithView:self.movieView viewController:self];
48 | self.playerContainerVC.view.backgroundColor = [UIColor blackColor];
49 | [self addChildViewController:self.playerContainerVC]; //增加子容器
50 | [self.movieView addSubview:self.playerContainerVC.view];
51 | }
52 |
53 | - (void)didReceiveMemoryWarning {
54 | [super didReceiveMemoryWarning];
55 | // Dispose of any resources that can be recreated.
56 | }
57 |
58 | - (void)backBtnAction:(UIButton *)sender {
59 | [self.navigationController popViewControllerAnimated:YES];
60 | }
61 |
62 | - (BOOL)shouldAutorotate
63 | {
64 | return NO;
65 | }
66 |
67 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
68 | {
69 | return UIInterfaceOrientationMaskPortrait;
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo/TableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 01/03/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "TableViewController.h"
10 | #import "PlayerContainerViewController.h"
11 |
12 | @interface TableViewController ()
13 |
14 | @property (nonatomic, strong) PlayerContainerViewController *playerContainerVC;
15 | @property (nonatomic, strong) NSIndexPath *indexPath;
16 | @property (nonatomic, strong) UITableView *tableView;
17 |
18 | @end
19 |
20 | @implementation TableViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | // Uncomment the following line to preserve selection between presentations.
26 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
27 | self.tableView.delegate = self;
28 | self.tableView.dataSource = self;
29 | self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
30 | [self.view addSubview:self.tableView];
31 |
32 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
33 | }
34 |
35 | - (void)didReceiveMemoryWarning {
36 | [super didReceiveMemoryWarning];
37 | // Dispose of any resources that can be recreated.
38 | }
39 |
40 | - (PlayerContainerViewController *)playerContainerVC
41 | {
42 | if (!_playerContainerVC) {
43 | _playerContainerVC = [[PlayerContainerViewController alloc] initWithView:nil viewController:self];
44 | _playerContainerVC.view.backgroundColor = [UIColor blackColor];
45 | _playerContainerVC.displayMiniRect = CGRectMake(10, self.view.bounds.size.height - 100 - 10, 160, 90);
46 | [self addChildViewController:self.playerContainerVC]; //增加子容器
47 | }
48 | return _playerContainerVC;
49 | }
50 |
51 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
52 | {
53 | return 211;
54 | }
55 |
56 | #pragma mark - Table view data source
57 |
58 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
59 | return 1;
60 | }
61 |
62 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
63 | return 10;
64 | }
65 |
66 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
67 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
68 |
69 | // Configure the cell...
70 |
71 | return cell;
72 | }
73 |
74 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
75 | {
76 | [tableView deselectRowAtIndexPath:indexPath animated:NO];
77 | self.indexPath = indexPath;
78 | UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
79 | [self.playerContainerVC showDisplayNormalInView:cell.contentView];
80 | }
81 |
82 | - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
83 | {
84 | if ([indexPath compare:self.indexPath] == NSOrderedSame) {
85 | [self.playerContainerVC showMiniDisplay:YES];
86 | }
87 | }
88 |
89 | - (BOOL)shouldAutorotate
90 | {
91 | return NO;
92 | }
93 |
94 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations
95 | {
96 | return UIInterfaceOrientationMaskPortrait;
97 | }
98 |
99 | @end
100 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo.xcodeproj/xcuserdata/mrlu.xcuserdatad/xcschemes/ChirdVCRotateDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/PlayerContainerViewController/class/PlayerContainerViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // PlayerContainerViewController.m
3 | // ChirdVCRotateDemo
4 | //
5 | // Created by Mrlu on 28/02/2017.
6 | // Copyright © 2017 Mrlu. All rights reserved.
7 | //
8 |
9 | #import "PlayerContainerViewController.h"
10 | #import "PlayerLandscapeViewController.h"
11 |
12 | // PMScreen
13 | #define PMPlayerScreenWidth ([UIScreen mainScreen].bounds.size.width < [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.width:[UIScreen mainScreen].bounds.size.height)
14 | #define PMPlayerScreenHeight ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.width:[UIScreen mainScreen].bounds.size.height)
15 |
16 | #define PMFullScreenFrame CGRectMake(0, 0, PMPlayerScreenHeight, PMPlayerScreenWidth)
17 |
18 | @interface PlayerContainerViewController ()
19 |
20 | @property (nonatomic, assign) CGRect displayFullRect;
21 | @property (nonatomic, assign) UIDeviceOrientation formOrientation;
22 | @property (nonatomic, assign) UIDeviceOrientation currentOrientation;
23 |
24 | @property (nonatomic, strong) UIView *superView;
25 | @property (nonatomic, strong) UIView *playerView;
26 | @property (nonatomic, strong) PlayerLandscapeViewController *landscapeViewController;
27 |
28 | @property (nonatomic, assign, readwrite) PlayerDisplayStyle displayStyle;
29 |
30 | @end
31 |
32 | @implementation PlayerContainerViewController
33 |
34 | - (void)dealloc
35 | {
36 | [[NSNotificationCenter defaultCenter] removeObserver:self];
37 | }
38 |
39 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
40 | {
41 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
42 | if (self) {
43 | self.displayStyle = PlayerDisplayStyleNormal;
44 | self.displayFullRect = PMFullScreenFrame;
45 | }
46 | return self;
47 | }
48 |
49 | - (instancetype)initWithViewController:(UIViewController *)viewController
50 | {
51 | return [self initWithView:nil viewController:viewController];
52 | }
53 |
54 | - (instancetype)initWithView:(nullable UIView *)view viewController:(UIViewController *)viewController
55 | {
56 | self = [super init];
57 | if (self) {
58 | if (view) {
59 | self.superView = view;
60 | self.displayNormalRect = view.bounds;
61 | }
62 | self.portraitViewController = viewController;
63 | }
64 | return self;
65 | }
66 |
67 | - (void)viewDidLoad {
68 | [super viewDidLoad];
69 | // Do any additional setup after loading the view.
70 | [self addNotification];
71 |
72 | self.view = self.playerView;
73 |
74 | switch (self.displayStyle) {
75 | case PlayerDisplayStyleFull:
76 | self.view.frame = self.displayFullRect;
77 | break;
78 | case PlayerDisplayStyleNormal:
79 | self.view.frame = self.displayNormalRect;
80 | break;
81 | case PlayerDisplayStyleMini:
82 | self.view.frame = self.displayMiniRect;
83 | break;
84 | default:
85 | break;
86 | }
87 | }
88 |
89 | - (void)didReceiveMemoryWarning {
90 | [super didReceiveMemoryWarning];
91 | // Dispose of any resources that can be recreated.
92 | }
93 |
94 | - (void)addNotification
95 | {
96 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChangeNotification:) name:UIDeviceOrientationDidChangeNotification object:nil];
97 | }
98 |
99 | - (void)changedUIAnimated:(BOOL)animated
100 | {
101 | if (self.displayStyle == PlayerDisplayStyleFull) { //全屏
102 | if ([self.parentViewController isEqual:self.landscapeViewController]) {
103 | self.formOrientation = [UIDevice currentDevice].orientation;
104 | return;
105 | }
106 | [self.parentViewController presentViewController:self.landscapeViewController animated:NO completion:^{
107 | //mvPlayer原先是作为protraitViewController的子UIViewControlle
108 | [self removeFromParentViewController];
109 | //改为作为landscapeViewController的子UIViewController
110 | [self.landscapeViewController addChildViewController:self];
111 | [self.landscapeViewController.view addSubview:self.view];
112 |
113 | //frame
114 | self.view.frame = self.displayFullRect;
115 |
116 | //旋转前
117 | if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
118 | CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI_2);
119 | self.view.transform = transform;
120 | } else if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
121 | CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI_2);
122 | self.view.transform = transform;
123 | }
124 |
125 | if (animated) {
126 | //旋转动画
127 | [UIView animateWithDuration:[UIApplication sharedApplication].statusBarOrientationAnimationDuration
128 | delay:0
129 | options:UIViewAnimationOptionCurveEaseInOut
130 | animations:^{
131 | self.view.transform = CGAffineTransformIdentity;
132 | }completion:^(BOOL finished){
133 | }];
134 | } else {
135 | self.view.transform = CGAffineTransformIdentity;
136 | }
137 | self.formOrientation = self.currentOrientation;
138 | }];
139 | } else if (self.displayStyle == PlayerDisplayStyleNormal) { //normal
140 | if ([self.parentViewController isEqual:self.portraitViewController]) {
141 | return;
142 | }
143 |
144 | //更改mvPlayer的父UIController
145 | [self.landscapeViewController dismissViewControllerAnimated:NO completion:^{
146 |
147 | [self removeFromParentViewController];
148 |
149 | [self.portraitViewController addChildViewController:self];
150 |
151 | if (self.superView) {
152 | [self.superView addSubview:self.view];
153 | } else {
154 | [self.portraitViewController.view addSubview:self.view];
155 | }
156 |
157 | self.view.frame = self.displayNormalRect;
158 |
159 | if (self.formOrientation == UIDeviceOrientationLandscapeLeft) {
160 | CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI_2);
161 | self.view.transform = transform;
162 | } else if (self.formOrientation == UIDeviceOrientationLandscapeRight) {
163 | CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI_2);
164 | self.view.transform = transform;
165 | }
166 | if (animated) {
167 | [UIView animateWithDuration:[UIApplication sharedApplication].statusBarOrientationAnimationDuration
168 | delay:0
169 | options:UIViewAnimationOptionCurveEaseInOut
170 | animations:^{
171 | self.view.transform = CGAffineTransformIdentity;
172 | }
173 | completion:^(BOOL finished) {
174 |
175 | }];
176 | } else {
177 | self.view.transform = CGAffineTransformIdentity;
178 | }
179 | self.formOrientation = self.currentOrientation;
180 | self.landscapeViewController = nil;
181 | }];
182 | } else if (self.displayStyle == PlayerDisplayStyleMini) { //mini
183 | if ([self.parentViewController isEqual:self.landscapeViewController]) {
184 | return;
185 | }
186 |
187 | [self.portraitViewController.view addSubview:self.view];
188 |
189 | //更改mvPlayer的父UIController
190 | if (animated) {
191 | [UIView animateWithDuration:[UIApplication sharedApplication].statusBarOrientationAnimationDuration
192 | delay:0
193 | options:UIViewAnimationOptionCurveEaseInOut
194 | animations:^{
195 | self.view.frame = self.displayMiniRect;
196 | }
197 | completion:^(BOOL finished) {
198 | self.view.frame = self.displayMiniRect;
199 | }];
200 | } else {
201 | self.view.frame = self.displayMiniRect;
202 | }
203 | self.formOrientation = self.currentOrientation;
204 | }
205 | }
206 |
207 | #pragma mark - property Getter/Setter
208 | - (UIView *)playerView
209 | {
210 | if (!_playerView) {
211 | _playerView = [UIView new];
212 | }
213 | return _playerView;
214 | }
215 |
216 | - (PlayerLandscapeViewController *)landscapeViewController
217 | {
218 | if (!_landscapeViewController) {
219 | _landscapeViewController = [PlayerLandscapeViewController new];
220 | }
221 | return _landscapeViewController;
222 | }
223 |
224 | - (void)setDisplayNormalRect:(CGRect)displayNormalRect
225 | {
226 | _displayNormalRect = displayNormalRect;
227 | if (self.displayStyle == PlayerDisplayStyleNormal) {
228 | self.view.frame = _displayNormalRect;
229 | }
230 | }
231 |
232 | #pragma mark - Public Interface
233 | - (void)showDisplayNormalInView:(UIView *)view {
234 | self.displayStyle = PlayerDisplayStyleNormal;
235 | self.displayNormalRect = view.bounds;
236 | self.view.frame = self.displayNormalRect;
237 | self.superView = view;
238 | [self.superView addSubview:self.view];
239 | }
240 |
241 | - (void)showMiniDisplay:(BOOL)ainimated {
242 | self.displayStyle = PlayerDisplayStyleMini;
243 | [self changedUIAnimated:ainimated];
244 | }
245 |
246 | - (void)changePlayerDisplayStyle:(PlayerDisplayStyle)disPlayStyle {
247 | if (self.displayStyle != disPlayStyle) {
248 | // 旋转后统一根据旋转后的方向设定type
249 | if (disPlayStyle == PlayerDisplayStyleFull) {
250 | [[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIInterfaceOrientationLandscapeRight] forKey:@"orientation"];
251 | } else {
252 | [[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIDeviceOrientationPortrait] forKey:@"orientation"];
253 | }
254 | }
255 | }
256 |
257 | #pragma mark - notification
258 | - (void)deviceOrientationDidChangeNotification:(NSNotification *)notification {
259 | UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
260 | if (orientation >= UIDeviceOrientationFaceUp || orientation == self.currentOrientation || orientation == UIDeviceOrientationUnknown || orientation == UIDeviceOrientationPortraitUpsideDown) {
261 | return;
262 | } else {
263 | self.currentOrientation = orientation;
264 | if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) {
265 | self.displayStyle = PlayerDisplayStyleFull;
266 | } else if (orientation == UIDeviceOrientationPortrait) {
267 | self.displayStyle = PlayerDisplayStyleNormal;
268 | }
269 | [self changedUIAnimated:YES];
270 | }
271 | }
272 |
273 |
274 | @end
275 |
--------------------------------------------------------------------------------
/ChirdVCRotateDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 085F4B311E6488DC00140920 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 085F4B301E6488DC00140920 /* main.m */; };
11 | 085F4B341E6488DC00140920 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 085F4B331E6488DC00140920 /* AppDelegate.m */; };
12 | 085F4B371E6488DC00140920 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 085F4B361E6488DC00140920 /* ViewController.m */; };
13 | 085F4B3C1E6488DC00140920 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 085F4B3B1E6488DC00140920 /* Assets.xcassets */; };
14 | 085F4B3F1E6488DC00140920 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 085F4B3D1E6488DC00140920 /* LaunchScreen.storyboard */; };
15 | 085F4B481E64890D00140920 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 085F4B471E64890D00140920 /* DetailViewController.m */; };
16 | 085F4B4B1E6491E200140920 /* NavViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 085F4B4A1E6491E200140920 /* NavViewController.m */; };
17 | 08641C591E65C2EF00CF0E75 /* PlayerContainerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08641C581E65C2EF00CF0E75 /* PlayerContainerViewController.m */; };
18 | 08A808291E65C4AB00EE4B93 /* PlayerLandscapeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08A808281E65C4AB00EE4B93 /* PlayerLandscapeViewController.m */; };
19 | 08A8082C1E65E2B900EE4B93 /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08A8082B1E65E2B900EE4B93 /* TableViewController.m */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXFileReference section */
23 | 085F4B2C1E6488DC00140920 /* ChirdVCRotateDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ChirdVCRotateDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
24 | 085F4B301E6488DC00140920 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
25 | 085F4B321E6488DC00140920 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
26 | 085F4B331E6488DC00140920 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
27 | 085F4B351E6488DC00140920 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
28 | 085F4B361E6488DC00140920 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
29 | 085F4B3B1E6488DC00140920 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
30 | 085F4B3E1E6488DC00140920 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
31 | 085F4B401E6488DC00140920 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
32 | 085F4B461E64890D00140920 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; };
33 | 085F4B471E64890D00140920 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; };
34 | 085F4B491E6491E200140920 /* NavViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavViewController.h; sourceTree = ""; };
35 | 085F4B4A1E6491E200140920 /* NavViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavViewController.m; sourceTree = ""; };
36 | 08641C571E65C2EF00CF0E75 /* PlayerContainerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerContainerViewController.h; sourceTree = ""; };
37 | 08641C581E65C2EF00CF0E75 /* PlayerContainerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayerContainerViewController.m; sourceTree = ""; };
38 | 08A808271E65C4AB00EE4B93 /* PlayerLandscapeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerLandscapeViewController.h; sourceTree = ""; };
39 | 08A808281E65C4AB00EE4B93 /* PlayerLandscapeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayerLandscapeViewController.m; sourceTree = ""; };
40 | 08A8082A1E65E2B900EE4B93 /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; };
41 | 08A8082B1E65E2B900EE4B93 /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 085F4B291E6488DC00140920 /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | );
50 | runOnlyForDeploymentPostprocessing = 0;
51 | };
52 | /* End PBXFrameworksBuildPhase section */
53 |
54 | /* Begin PBXGroup section */
55 | 083721481E65C03800622CCF /* PlayerContainerViewController */ = {
56 | isa = PBXGroup;
57 | children = (
58 | 083721491E65C04C00622CCF /* class */,
59 | );
60 | path = PlayerContainerViewController;
61 | sourceTree = "";
62 | };
63 | 083721491E65C04C00622CCF /* class */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 08641C571E65C2EF00CF0E75 /* PlayerContainerViewController.h */,
67 | 08641C581E65C2EF00CF0E75 /* PlayerContainerViewController.m */,
68 | 08A808271E65C4AB00EE4B93 /* PlayerLandscapeViewController.h */,
69 | 08A808281E65C4AB00EE4B93 /* PlayerLandscapeViewController.m */,
70 | );
71 | path = class;
72 | sourceTree = "";
73 | };
74 | 085F4B231E6488DC00140920 = {
75 | isa = PBXGroup;
76 | children = (
77 | 083721481E65C03800622CCF /* PlayerContainerViewController */,
78 | 085F4B2E1E6488DC00140920 /* ChirdVCRotateDemo */,
79 | 085F4B2D1E6488DC00140920 /* Products */,
80 | );
81 | sourceTree = "";
82 | };
83 | 085F4B2D1E6488DC00140920 /* Products */ = {
84 | isa = PBXGroup;
85 | children = (
86 | 085F4B2C1E6488DC00140920 /* ChirdVCRotateDemo.app */,
87 | );
88 | name = Products;
89 | sourceTree = "";
90 | };
91 | 085F4B2E1E6488DC00140920 /* ChirdVCRotateDemo */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 085F4B321E6488DC00140920 /* AppDelegate.h */,
95 | 085F4B331E6488DC00140920 /* AppDelegate.m */,
96 | 085F4B351E6488DC00140920 /* ViewController.h */,
97 | 085F4B361E6488DC00140920 /* ViewController.m */,
98 | 085F4B491E6491E200140920 /* NavViewController.h */,
99 | 085F4B4A1E6491E200140920 /* NavViewController.m */,
100 | 085F4B461E64890D00140920 /* DetailViewController.h */,
101 | 085F4B471E64890D00140920 /* DetailViewController.m */,
102 | 08A8082A1E65E2B900EE4B93 /* TableViewController.h */,
103 | 08A8082B1E65E2B900EE4B93 /* TableViewController.m */,
104 | 085F4B3B1E6488DC00140920 /* Assets.xcassets */,
105 | 085F4B3D1E6488DC00140920 /* LaunchScreen.storyboard */,
106 | 085F4B401E6488DC00140920 /* Info.plist */,
107 | 085F4B2F1E6488DC00140920 /* Supporting Files */,
108 | );
109 | path = ChirdVCRotateDemo;
110 | sourceTree = "";
111 | };
112 | 085F4B2F1E6488DC00140920 /* Supporting Files */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 085F4B301E6488DC00140920 /* main.m */,
116 | );
117 | name = "Supporting Files";
118 | sourceTree = "";
119 | };
120 | /* End PBXGroup section */
121 |
122 | /* Begin PBXNativeTarget section */
123 | 085F4B2B1E6488DC00140920 /* ChirdVCRotateDemo */ = {
124 | isa = PBXNativeTarget;
125 | buildConfigurationList = 085F4B431E6488DC00140920 /* Build configuration list for PBXNativeTarget "ChirdVCRotateDemo" */;
126 | buildPhases = (
127 | 085F4B281E6488DC00140920 /* Sources */,
128 | 085F4B291E6488DC00140920 /* Frameworks */,
129 | 085F4B2A1E6488DC00140920 /* Resources */,
130 | );
131 | buildRules = (
132 | );
133 | dependencies = (
134 | );
135 | name = ChirdVCRotateDemo;
136 | productName = ChirdVCRotateDemo;
137 | productReference = 085F4B2C1E6488DC00140920 /* ChirdVCRotateDemo.app */;
138 | productType = "com.apple.product-type.application";
139 | };
140 | /* End PBXNativeTarget section */
141 |
142 | /* Begin PBXProject section */
143 | 085F4B241E6488DC00140920 /* Project object */ = {
144 | isa = PBXProject;
145 | attributes = {
146 | LastUpgradeCheck = 0820;
147 | ORGANIZATIONNAME = Mrlu;
148 | TargetAttributes = {
149 | 085F4B2B1E6488DC00140920 = {
150 | CreatedOnToolsVersion = 8.2.1;
151 | ProvisioningStyle = Manual;
152 | };
153 | };
154 | };
155 | buildConfigurationList = 085F4B271E6488DC00140920 /* Build configuration list for PBXProject "ChirdVCRotateDemo" */;
156 | compatibilityVersion = "Xcode 3.2";
157 | developmentRegion = English;
158 | hasScannedForEncodings = 0;
159 | knownRegions = (
160 | en,
161 | Base,
162 | );
163 | mainGroup = 085F4B231E6488DC00140920;
164 | productRefGroup = 085F4B2D1E6488DC00140920 /* Products */;
165 | projectDirPath = "";
166 | projectRoot = "";
167 | targets = (
168 | 085F4B2B1E6488DC00140920 /* ChirdVCRotateDemo */,
169 | );
170 | };
171 | /* End PBXProject section */
172 |
173 | /* Begin PBXResourcesBuildPhase section */
174 | 085F4B2A1E6488DC00140920 /* Resources */ = {
175 | isa = PBXResourcesBuildPhase;
176 | buildActionMask = 2147483647;
177 | files = (
178 | 085F4B3F1E6488DC00140920 /* LaunchScreen.storyboard in Resources */,
179 | 085F4B3C1E6488DC00140920 /* Assets.xcassets in Resources */,
180 | );
181 | runOnlyForDeploymentPostprocessing = 0;
182 | };
183 | /* End PBXResourcesBuildPhase section */
184 |
185 | /* Begin PBXSourcesBuildPhase section */
186 | 085F4B281E6488DC00140920 /* Sources */ = {
187 | isa = PBXSourcesBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | 085F4B371E6488DC00140920 /* ViewController.m in Sources */,
191 | 085F4B341E6488DC00140920 /* AppDelegate.m in Sources */,
192 | 085F4B311E6488DC00140920 /* main.m in Sources */,
193 | 08641C591E65C2EF00CF0E75 /* PlayerContainerViewController.m in Sources */,
194 | 085F4B481E64890D00140920 /* DetailViewController.m in Sources */,
195 | 08A808291E65C4AB00EE4B93 /* PlayerLandscapeViewController.m in Sources */,
196 | 085F4B4B1E6491E200140920 /* NavViewController.m in Sources */,
197 | 08A8082C1E65E2B900EE4B93 /* TableViewController.m in Sources */,
198 | );
199 | runOnlyForDeploymentPostprocessing = 0;
200 | };
201 | /* End PBXSourcesBuildPhase section */
202 |
203 | /* Begin PBXVariantGroup section */
204 | 085F4B3D1E6488DC00140920 /* LaunchScreen.storyboard */ = {
205 | isa = PBXVariantGroup;
206 | children = (
207 | 085F4B3E1E6488DC00140920 /* Base */,
208 | );
209 | name = LaunchScreen.storyboard;
210 | sourceTree = "";
211 | };
212 | /* End PBXVariantGroup section */
213 |
214 | /* Begin XCBuildConfiguration section */
215 | 085F4B411E6488DC00140920 /* Debug */ = {
216 | isa = XCBuildConfiguration;
217 | buildSettings = {
218 | ALWAYS_SEARCH_USER_PATHS = NO;
219 | CLANG_ANALYZER_NONNULL = YES;
220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
221 | CLANG_CXX_LIBRARY = "libc++";
222 | CLANG_ENABLE_MODULES = YES;
223 | CLANG_ENABLE_OBJC_ARC = YES;
224 | CLANG_WARN_BOOL_CONVERSION = YES;
225 | CLANG_WARN_CONSTANT_CONVERSION = YES;
226 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
227 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
228 | CLANG_WARN_EMPTY_BODY = YES;
229 | CLANG_WARN_ENUM_CONVERSION = YES;
230 | CLANG_WARN_INFINITE_RECURSION = YES;
231 | CLANG_WARN_INT_CONVERSION = YES;
232 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
233 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
234 | CLANG_WARN_UNREACHABLE_CODE = YES;
235 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
237 | COPY_PHASE_STRIP = NO;
238 | DEBUG_INFORMATION_FORMAT = dwarf;
239 | ENABLE_STRICT_OBJC_MSGSEND = YES;
240 | ENABLE_TESTABILITY = YES;
241 | GCC_C_LANGUAGE_STANDARD = gnu99;
242 | GCC_DYNAMIC_NO_PIC = NO;
243 | GCC_NO_COMMON_BLOCKS = YES;
244 | GCC_OPTIMIZATION_LEVEL = 0;
245 | GCC_PREPROCESSOR_DEFINITIONS = (
246 | "DEBUG=1",
247 | "$(inherited)",
248 | );
249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
251 | GCC_WARN_UNDECLARED_SELECTOR = YES;
252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
253 | GCC_WARN_UNUSED_FUNCTION = YES;
254 | GCC_WARN_UNUSED_VARIABLE = YES;
255 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
256 | MTL_ENABLE_DEBUG_INFO = YES;
257 | ONLY_ACTIVE_ARCH = YES;
258 | SDKROOT = iphoneos;
259 | TARGETED_DEVICE_FAMILY = "1,2";
260 | };
261 | name = Debug;
262 | };
263 | 085F4B421E6488DC00140920 /* Release */ = {
264 | isa = XCBuildConfiguration;
265 | buildSettings = {
266 | ALWAYS_SEARCH_USER_PATHS = NO;
267 | CLANG_ANALYZER_NONNULL = YES;
268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
269 | CLANG_CXX_LIBRARY = "libc++";
270 | CLANG_ENABLE_MODULES = YES;
271 | CLANG_ENABLE_OBJC_ARC = YES;
272 | CLANG_WARN_BOOL_CONVERSION = YES;
273 | CLANG_WARN_CONSTANT_CONVERSION = YES;
274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
275 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
276 | CLANG_WARN_EMPTY_BODY = YES;
277 | CLANG_WARN_ENUM_CONVERSION = YES;
278 | CLANG_WARN_INFINITE_RECURSION = YES;
279 | CLANG_WARN_INT_CONVERSION = YES;
280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
281 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
282 | CLANG_WARN_UNREACHABLE_CODE = YES;
283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
284 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
285 | COPY_PHASE_STRIP = NO;
286 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
287 | ENABLE_NS_ASSERTIONS = NO;
288 | ENABLE_STRICT_OBJC_MSGSEND = YES;
289 | GCC_C_LANGUAGE_STANDARD = gnu99;
290 | GCC_NO_COMMON_BLOCKS = YES;
291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
293 | GCC_WARN_UNDECLARED_SELECTOR = YES;
294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
295 | GCC_WARN_UNUSED_FUNCTION = YES;
296 | GCC_WARN_UNUSED_VARIABLE = YES;
297 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
298 | MTL_ENABLE_DEBUG_INFO = NO;
299 | SDKROOT = iphoneos;
300 | TARGETED_DEVICE_FAMILY = "1,2";
301 | VALIDATE_PRODUCT = YES;
302 | };
303 | name = Release;
304 | };
305 | 085F4B441E6488DC00140920 /* Debug */ = {
306 | isa = XCBuildConfiguration;
307 | buildSettings = {
308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
309 | DEVELOPMENT_TEAM = "";
310 | INFOPLIST_FILE = ChirdVCRotateDemo/Info.plist;
311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
312 | PRODUCT_BUNDLE_IDENTIFIER = Mrlu.ChirdVCRotateDemo;
313 | PRODUCT_NAME = "$(TARGET_NAME)";
314 | };
315 | name = Debug;
316 | };
317 | 085F4B451E6488DC00140920 /* Release */ = {
318 | isa = XCBuildConfiguration;
319 | buildSettings = {
320 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
321 | DEVELOPMENT_TEAM = "";
322 | INFOPLIST_FILE = ChirdVCRotateDemo/Info.plist;
323 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
324 | PRODUCT_BUNDLE_IDENTIFIER = Mrlu.ChirdVCRotateDemo;
325 | PRODUCT_NAME = "$(TARGET_NAME)";
326 | };
327 | name = Release;
328 | };
329 | /* End XCBuildConfiguration section */
330 |
331 | /* Begin XCConfigurationList section */
332 | 085F4B271E6488DC00140920 /* Build configuration list for PBXProject "ChirdVCRotateDemo" */ = {
333 | isa = XCConfigurationList;
334 | buildConfigurations = (
335 | 085F4B411E6488DC00140920 /* Debug */,
336 | 085F4B421E6488DC00140920 /* Release */,
337 | );
338 | defaultConfigurationIsVisible = 0;
339 | defaultConfigurationName = Release;
340 | };
341 | 085F4B431E6488DC00140920 /* Build configuration list for PBXNativeTarget "ChirdVCRotateDemo" */ = {
342 | isa = XCConfigurationList;
343 | buildConfigurations = (
344 | 085F4B441E6488DC00140920 /* Debug */,
345 | 085F4B451E6488DC00140920 /* Release */,
346 | );
347 | defaultConfigurationIsVisible = 0;
348 | defaultConfigurationName = Release;
349 | };
350 | /* End XCConfigurationList section */
351 | };
352 | rootObject = 085F4B241E6488DC00140920 /* Project object */;
353 | }
354 |
--------------------------------------------------------------------------------