HTML Text Show in WebView Clickable

CompanyViewController.h

#import “ViewController.h”

#import “Utility.h”

@interface CompanyViewController : ViewController

@property (strong, nonatomic) NSMutableDictionary *dictionaryJSON;

@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

CompanyViewController.m

#import “CompanyViewController.h”

@interface CompanyViewController ()

@end

@implementation CompanyViewController

– (void)viewDidLoad {

    [super viewDidLoad];

    

    _dictionaryJSON = [[NSMutableDictionary alloc]init];

    _dictionaryJSON = [Utility getValueFromJsonFile_FileName:@”CompanyFile” FileType:@”json”];

    

    NSLog(@”%@”,_dictionaryJSON);

    NSLog(@”%@”,[[_dictionaryJSON objectForKey:@”data”]valueForKeyPath:@”content.static”]);

    

    NSString *string = [[_dictionaryJSON objectForKey:@”data”]valueForKeyPath:@”content.static”];

    NSLog(@”%@”,string);

    

    

    [_webView loadHTMLString:string baseURL:nil];

    

    

    // Do any additional setup after loading the view.

}

– (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}

/*

#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

Download Sample Project From Github

Leave a comment