Commit 450d41c4 authored by Carola Nitz's avatar Carola Nitz

remove knowledge of the videoViewController into the menuViewController

parent 30f7c58a
......@@ -15,18 +15,13 @@
*****************************************************************************/
#import "VLCMenuTableViewController.h"
#import "VLCDownloadViewController.h"
#import "VLCWatchCommunication.h"
#import <AppAuth/AppAuth.h>
@class VLCVideoViewController;
extern NSString *const VLCDropboxSessionWasAuthorized;
@interface VLCAppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, readonly) VLCVideoViewController *videoViewController;
@property (nonatomic, readonly) VLCWatchCommunication *watchCommunication;
@property (nonatomic, strong) UIWindow *window;
......
......@@ -21,7 +21,6 @@
#import "VLCMediaFileDiscoverer.h"
#import "NSString+SupportedMedia.h"
#import "UIDevice+VLC.h"
#import "VLCLibraryViewController.h"
#import "VLCHTTPUploaderController.h"
#import "VLCMigrationViewController.h"
#import <BoxSDK/BoxSDK.h>
......@@ -31,6 +30,7 @@
#import <HockeySDK/HockeySDK.h>
#import "VLCActivityManager.h"
#import "VLCDropboxConstants.h"
#import "VLCDownloadViewController.h"
#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
#import "VLCPlaybackNavigationController.h"
#import "PAPasscodeViewController.h"
......@@ -110,7 +110,6 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
void (^setupBlock)() = ^{
__weak typeof(self) weakSelf = self;
void (^setupLibraryBlock)() = ^{
_videoViewController = [[VLCVideoViewController alloc] initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
appCoordinator = [[AppCoordinator alloc] initWithWindow:weakSelf.window];
[appCoordinator start];
};
......
......@@ -19,14 +19,14 @@
#import "VLCSidebarViewCell.h"
#import <QuartzCore/QuartzCore.h>
#import "VLCWiFiUploadTableViewCell.h"
#import "VLCAppDelegate.h"
#import "VLCDownloadViewController.h"
#import "VLCServerListViewController.h"
#import "VLCOpenNetworkStreamViewController.h"
#import "VLCSettingsController.h"
#import "VLCAboutViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCBugreporter.h"
#import "VLCCloudServicesTableViewController.h"
#import "VLC_iOS-Swift.h"
#define ROW_HEIGHT 50.
#define IPAD_ROW_HEIGHT 65.
......@@ -51,6 +51,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
NSLayoutConstraint *_heightConstraint;
NSLayoutConstraint *_leftTableConstraint;
VLCSettingsController *_settingsController;
VLCVideoViewController *_videoViewController;
}
@end
......@@ -104,7 +105,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
[self.view addConstraint:_leftTableConstraint];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|->=0-[_menuTableView(==menuWidth)]" options:0 metrics:metrics views:dict]];
[_menuTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
[self selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
}
- (BOOL)shouldAutorotate
......@@ -231,10 +232,17 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
return _settingsController;
}
- (VLCVideoViewController *)videoViewController
{
if (!_videoViewController){
_videoViewController = [[VLCVideoViewController alloc] initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
}
return _videoViewController;
}
- (void)_revealItem:(NSUInteger)itemIndex inSection:(NSUInteger)sectionNumber
{
UIViewController *viewController;
VLCAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
if (sectionNumber == 1) {
if (itemIndex == 0)
viewController = [[VLCServerListViewController alloc] init];
......@@ -252,8 +260,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
} else if (itemIndex == 1)
viewController = [[VLCAboutViewController alloc] init];
} else {
viewController = appDelegate.videoViewController;
[(VLCLibraryViewController *)viewController setLibraryMode:(int)itemIndex];
viewController = self.videoViewController;
}
if (!viewController) {
......
......@@ -14,7 +14,6 @@
#import "VLCPlaybackController.h"
#import "VLCMiniPlaybackView.h"
#import "VLCPlaybackNavigationController.h"
#import "VLCAppDelegate.h"
#import "VLC_iOS-Swift.h"
#if TARGET_OS_IOS
......@@ -72,10 +71,6 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
[super viewDidLoad];
VLCSidebarController *sidebarVC = [VLCSidebarController sharedInstance];
VLCVideoViewController *libCon = ((VLCAppDelegate *)[UIApplication sharedApplication].delegate).videoViewController;
UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:libCon];
sidebarVC.contentViewController = navCon;
_childViewController = sidebarVC.fullViewController;
[self setupChildViewController];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment