| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // SearchlistViewController.m
- // Apex Mobile
- //
- // Created by Ray on 25/01/2018.
- // Copyright © 2018 United Software Applications, Inc. All rights reserved.
- //
- #import "SearchlistViewController.h"
- #import "SearchViewController.h"
- @interface SearchlistViewController ()
- @end
- @implementation SearchlistViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
-
-
- [self clearNavigationbar];
- [self configureNavigationBar];
- }
- - (void)clearNavigationbar {
- self.tabBarController.navigationItem.leftBarButtonItem = nil;
- self.tabBarController.navigationItem.leftBarButtonItems = nil;
- self.tabBarController.navigationItem.titleView = nil;
- self.tabBarController.navigationItem.title = nil;
- self.tabBarController.navigationItem.rightBarButtonItem = nil;
- self.tabBarController.navigationItem.rightBarButtonItems = nil;
- }
- - (void)configureNavigationBar {
-
- if (self.navigationController && !self.navigationController.isNavigationBarHidden) {
-
- UIImage *logo = [[UIImage imageNamed:@"apexlogo-2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- UIBarButtonItem *logoItem = [[UIBarButtonItem alloc] initWithImage:logo landscapeImagePhone:logo style:UIBarButtonItemStylePlain target:nil action:nil];
- logoItem.enabled = NO;
- self.tabBarController.navigationItem.leftBarButtonItem = logoItem;
-
-
- }
- }
- - (void)LoadModelist
- {
- NSData* json =[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"search" ofType:@"json" ]];
-
-
-
- if(json==nil)
- {
- self.modelist = nil;
-
- }
- NSError *error=nil;
- NSDictionary* modelistjson = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] ;
- self.modelist = modelistjson[@"modelist"];
- // self.navigationItem.title = ;
-
- self.title = modelistjson[@"title"];
- self.tabBarItem.image= [UIImage imageNamed:modelistjson[@"icon"]];
-
- // NSAssert(true, ([NSString stringWithFormat:@"%s LoadModelist not impl",object_getClassName([self class])]));
- }
- -(void)PerformAction:(NSString*) type
- {
- NSString *function_name;
-
-
- if([type isEqualToString:@"ocean_booking"])
- {
- function_name = @"Ocean Booking";
- }
- else if([type isEqualToString:@"ocean_blinfo"])
- {
- function_name = @"Ocean B/L info.";
- }
- else if([type isEqualToString:@"container_detail"])
- {
- function_name = @"Container detail";
- }
- else if([type isEqualToString:@"document"])
- {
-
- function_name = @"Download Document";
- }
- SearchViewController *searchViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SearchViewController"];
- searchViewController.function_name = function_name;
- [self.navigationController pushViewController:searchViewController animated:YES];
-
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|