Просмотр исходного кода

About code simplification: create view controller if needed

Gleb Pinigin 12 лет назад
Родитель
Сommit
c81187a190

+ 0 - 3
AspenProject/VLCAboutViewController.m

@@ -35,15 +35,12 @@
 - (void)viewWillAppear:(BOOL)animated
 {
     [self.navigationController setNavigationBarHidden:YES animated:NO];
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
-        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
     [super viewWillAppear:animated];
 }
 
 - (void)viewWillDisappear:(BOOL)animated
 {
     [self.navigationController setNavigationBarHidden:NO animated:YES];
-    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
     [super viewWillDisappear:animated];
 }
 

+ 2 - 4
AspenProject/VLCAddMediaViewController.m

@@ -102,10 +102,8 @@
 - (IBAction)openAboutPanel:(id)sender
 {
     VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
-
-    if (!appDelegate.playlistViewController.aboutViewController)
-        appDelegate.playlistViewController.aboutViewController = [[VLCAboutViewController alloc] initWithNibName:@"VLCAboutViewController" bundle:nil];
-    [appDelegate.playlistViewController.navigationController pushViewController:appDelegate.playlistViewController.aboutViewController animated:YES];
+    UIViewController *aboutController = [[VLCAboutViewController alloc] initWithNibName:@"VLCAboutViewController" bundle:nil];
+    [appDelegate.playlistViewController.navigationController pushViewController:aboutController animated:YES];
 
     [self _hideAnimated:NO];
 }

+ 0 - 3
AspenProject/VLCPlaylistViewController.h

@@ -10,7 +10,6 @@
 #import "AQGridView.h"
 
 @class VLCMovieViewController;
-@class VLCAboutViewController;
 @class VLCAddMediaViewController;
 
 @interface VLCPlaylistViewController : UIViewController <AQGridViewDataSource, AQGridViewDelegate, UITableViewDataSource, UITableViewDelegate, UITabBarDelegate, UIPopoverControllerDelegate>
@@ -19,9 +18,7 @@
 }
 
 @property (nonatomic, strong) VLCMovieViewController *movieViewController;
-@property (nonatomic, strong) VLCAboutViewController *aboutViewController;
 @property (nonatomic, strong) VLCAddMediaViewController *addMediaViewController;
-
 @property (nonatomic, strong) UIPopoverController *addMediaPopoverController;
 
 @property (nonatomic, strong) IBOutlet UITableView *tableView;

+ 0 - 1
AspenProject/VLCPlaylistViewController.m

@@ -10,7 +10,6 @@
 #import "VLCMovieViewController.h"
 #import "VLCPlaylistTableViewCell.h"
 #import "VLCPlaylistGridView.h"
-#import "VLCAboutViewController.h"
 #import "VLCAddMediaViewController.h"
 
 @interface VLCPlaylistViewController () {