Ale*_*abe 6 favicon uiimageview rss-reader ios
我正在开发一个RSS阅读器,我需要为每个Feed获取favicon.例如,如果我的Feed是google.com,我想获得"G"图标并将其放入UIImage或其他内容.关于如何实现这一点的任何想法?
El *_*per 19
最简单的方法是使用Google:
NSString *myURLString = @"http://www.google.com/s2/favicons?domain=www.stackoverflow.com";
NSURL *myURL=[NSURL URLWithString: myURLString];
NSData *myData=[NSData dataWithContentsOfURL:myURL];
UIImage *myImage=[[UIImage alloc] initWithData:myData];
Run Code Online (Sandbox Code Playgroud)
这应该工作.
您只需要替换要查询图标的域.