diff --git a/UniversityPrograms/UniversityPrograms/ContactUPMapViewController.m b/UniversityPrograms/UniversityPrograms/ContactUPMapViewController.m index 0ea0f89..deab961 100644 --- a/UniversityPrograms/UniversityPrograms/ContactUPMapViewController.m +++ b/UniversityPrograms/UniversityPrograms/ContactUPMapViewController.m @@ -27,6 +27,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil } return self; } + -(void)viewWillAppear:(BOOL)animated{ MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; if(self.lat&&self.lng){ diff --git a/UniversityPrograms/UniversityPrograms/ContactUPViewController.m b/UniversityPrograms/UniversityPrograms/ContactUPViewController.m index ff3d454..a37fd25 100644 --- a/UniversityPrograms/UniversityPrograms/ContactUPViewController.m +++ b/UniversityPrograms/UniversityPrograms/ContactUPViewController.m @@ -34,7 +34,9 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil } return self; } - +-(void)viewDidAppear:(BOOL)animated{ + +} - (void)viewDidLoad{ [super viewDidLoad]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Comment" style:UIBarButtonItemStyleDone target:self action:@selector(didTouchFeedback)]; @@ -43,9 +45,13 @@ - (void)viewDidLoad{ } -(void) viewWillAppear:(BOOL)animated{ - [self.contactUPTableView reloadData]; + self.contactUPTableView.backgroundColor=[UIColor getStyleColor]; self.contactUPTableView.separatorColor = [UIColor getThemeColor]; + if(self.child){ + [self.child viewWillAppear:NO]; + } + [self.contactUPTableView reloadData]; } - (void)didReceiveMemoryWarning{ diff --git a/UniversityPrograms/UniversityPrograms/MyUPViewController.h b/UniversityPrograms/UniversityPrograms/MyUPViewController.h index 02d94c6..c9c8928 100644 --- a/UniversityPrograms/UniversityPrograms/MyUPViewController.h +++ b/UniversityPrograms/UniversityPrograms/MyUPViewController.h @@ -12,5 +12,5 @@ @interface MyUPViewController : UPViewController - +-(void)viewWillAppear:(BOOL)animated; @end diff --git a/UniversityPrograms/UniversityPrograms/SettingsViewController.m b/UniversityPrograms/UniversityPrograms/SettingsViewController.m index 5ec08e0..9c51d26 100644 --- a/UniversityPrograms/UniversityPrograms/SettingsViewController.m +++ b/UniversityPrograms/UniversityPrograms/SettingsViewController.m @@ -18,6 +18,7 @@ @interface SettingsViewController () @property (weak, nonatomic) IBOutlet UILabel *colorSchemeLabel; @property (weak, nonatomic) IBOutlet UIView *dividerView; @property NKOColorPickerView *colorPickerView; +@property NSOperationQueue *queue; @end @implementation SettingsViewController @@ -27,6 +28,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.title=@"Settings"; + // Custom initialization } return self; @@ -68,11 +70,8 @@ - (IBAction)toggledDarkMode:(id)sender { if(base.child){ [base.child viewWillAppear:NO]; } - [self viewWillAppear:NO]; - - - } + [self viewWillAppear:NO]; } else{ //[[UITextView appearance] setKeyboardAppearance:UIKeyboardAppearanceLight]; @@ -92,8 +91,9 @@ - (IBAction)toggledDarkMode:(id)sender { if(base.child){ [base.child viewWillAppear:NO]; } - [self viewWillAppear:NO]; + } + [self viewWillAppear:NO]; } @@ -153,17 +153,9 @@ -(void)changedColorScheme:(UIColor *)color { } -(void)updateColors:(UIColor *)color{ - for (int index=0; index - +#import "UPViewController.h" @interface UPNavigationViewController : UINavigationController - +@property UPViewController *rootViewController; @end diff --git a/UniversityPrograms/UniversityPrograms/UPNavigationViewController.m b/UniversityPrograms/UniversityPrograms/UPNavigationViewController.m index 3d3f1bf..be50ac4 100644 --- a/UniversityPrograms/UniversityPrograms/UPNavigationViewController.m +++ b/UniversityPrograms/UniversityPrograms/UPNavigationViewController.m @@ -15,7 +15,14 @@ @interface UPNavigationViewController () @end @implementation UPNavigationViewController - +-(id)initWithRootViewController:(UPViewController *)rootViewController{ + self=[super initWithRootViewController:rootViewController]; + + self.rootViewController = rootViewController; + + + return self; +} - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; diff --git a/UniversityPrograms/UniversityPrograms/UPTabbarViewController.m b/UniversityPrograms/UniversityPrograms/UPTabbarViewController.m index 28e13c8..9866364 100644 --- a/UniversityPrograms/UniversityPrograms/UPTabbarViewController.m +++ b/UniversityPrograms/UniversityPrograms/UPTabbarViewController.m @@ -5,11 +5,13 @@ // Created by Miles Crabbe on 6/10/14. // Copyright (c) 2014 CAPS. All rights reserved. // - +#import "UPNavigationViewController.h" #import "UPTabbarViewController.h" #import "UPViewController.h" #import "UIColor+UPColors.h" #import "IntroPanel.h" +#import "ContactUPViewController.h" +#import "MyUPViewController.h" @interface UPTabbarViewController () @end @@ -37,8 +39,10 @@ - (void)didReceiveMemoryWarning [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UPViewController *)viewController{ - [viewController viewDidAppear:NO]; +- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UPNavigationViewController *)viewControllerSp{ + UPViewController *test = viewControllerSp.rootViewController; + [test viewWillAppear:NO]; + viewControllerSp.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor getThemeColor], NSFontAttributeName : [UIFont systemFontOfSize:20]}; } -(void)buildIntroView{ @@ -75,6 +79,8 @@ -(void)buildIntroView{ } + + /* #pragma mark - Navigation diff --git a/UniversityPrograms/UniversityPrograms/UPViewController.m b/UniversityPrograms/UniversityPrograms/UPViewController.m index 23c4466..559f030 100644 --- a/UniversityPrograms/UniversityPrograms/UPViewController.m +++ b/UniversityPrograms/UniversityPrograms/UPViewController.m @@ -30,9 +30,10 @@ - (void)viewDidLoad // Do any additional setup after loading the view. } --(void)viewDidAppear:(BOOL)animated{ - //[self.tableview reloadData]; +-(void)viewWillAppear:(BOOL)animated{ + } + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/UniversityPrograms/UniversityPrograms/UpcomingEventViewController.m b/UniversityPrograms/UniversityPrograms/UpcomingEventViewController.m index 8c7c7b6..49810f2 100644 --- a/UniversityPrograms/UniversityPrograms/UpcomingEventViewController.m +++ b/UniversityPrograms/UniversityPrograms/UpcomingEventViewController.m @@ -59,7 +59,9 @@ - (void)didReceiveMemoryWarning -(void)viewWillAppear:(BOOL)animated{ //self.upComingEventsTable.backgroundColor = [UIColor getStyleColor]; [self loadEvents]; - + if(self.child){ + [self.child viewWillAppear:NO]; + } //[self.upComingEventsTable reloadData]; //[self.upComingEventsTable scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO]; }