Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Thumb image and title of particular Website URL in iOS?

enter image description here

I have to display thumb image and get title of WEB URL same as LinkedIN app and Skype app in iOS?

Is there any Solution?

like image 747
Parthpatel1105 Avatar asked Mar 29 '16 15:03

Parthpatel1105


1 Answers

Here is the easiest way to find the favicon icon of URL

NSString *myURLString = @"http://www.google.com/s2/favicons?domain=www.facebook.com";
NSURL *myURL=[NSURL URLWithString: myURLString];
NSData *myData=[NSData dataWithContentsOfURL:myURL];

UIImage *myImage=[[UIImage alloc] initWithData:myData];

Swift Version:

let myURLString = "http://www.google.com/s2/favicons?domain=www.facebook.com"
let myURL = NSURL(string: myURLString)!
let myData = NSData.dataWithContentsOfURL(myURL)
let myImage = UIImage(data: myData)!

May this helps lot

UPDATE

Below is the swift library which helps to load images like you want.

URLEmbeddedView

Here You can check actual work of library.

like image 173
Nimit Parekh Avatar answered Oct 06 '22 00:10

Nimit Parekh