Skip to content

Commit

Permalink
-now it is working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCrabbe committed Jun 25, 2014
1 parent a346c5a commit 332424a
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
10 changes: 8 additions & 2 deletions UniversityPrograms/UniversityPrograms/ContactUPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion UniversityPrograms/UniversityPrograms/MyUPViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
@interface MyUPViewController : UPViewController <UITableViewDelegate,UITableViewDataSource>



-(void)viewWillAppear:(BOOL)animated;
@end
24 changes: 8 additions & 16 deletions UniversityPrograms/UniversityPrograms/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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];
Expand All @@ -92,8 +91,9 @@ - (IBAction)toggledDarkMode:(id)sender {
if(base.child){
[base.child viewWillAppear:NO];
}
[self viewWillAppear:NO];

}
[self viewWillAppear:NO];
}


Expand Down Expand Up @@ -153,17 +153,9 @@ -(void)changedColorScheme:(UIColor *)color {

}
-(void)updateColors:(UIColor *)color{
for (int index=0; index<self.tabBarController.viewControllers.count; index++) {
UPNavigationViewController *controller = [self.tabBarController.viewControllers objectAtIndex:index];
controller.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor getThemeColor], NSFontAttributeName : [UIFont systemFontOfSize:20]};
controller.tabBarController.tabBar.tintColor = [UIColor getThemeColor];
UPViewController *base = controller.viewControllers[0];

[base viewWillAppear:NO];
if(base.child){
[base.child viewWillAppear:NO];
}
}
self.tabBarController.tabBar.tintColor = [UIColor getThemeColor];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor getThemeColor], NSFontAttributeName : [UIFont systemFontOfSize:20]};

[self viewWillAppear:NO];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <UIKit/UIKit.h>

#import "UPViewController.h"
@interface UPNavigationViewController : UINavigationController

@property UPViewController *rootViewController;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
12 changes: 9 additions & 3 deletions UniversityPrograms/UniversityPrograms/UPTabbarViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -75,6 +79,8 @@ -(void)buildIntroView{

}



/*
#pragma mark - Navigation
Expand Down
5 changes: 3 additions & 2 deletions UniversityPrograms/UniversityPrograms/UPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 332424a

Please sign in to comment.