How to get a web page preview from a URL Goal c

I need to set a url like this:

enter image description here

and show something like this:

enter image description here

can this be obtained?

+4
source share
1 answer

use this library: " URLEmbeddedView "

you can find the code here: https://github.com/szk-atmosphere/URLEmbeddedView

this library is written quickly, but you can use it in objective-c.

objective-c Simple code is in class OGObjcSampleViewController "

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.textView.text = @"https://github.com/";

    [OGDataProvider sharedInstance].updateInterval = [NSNumber days:10];

    self.embeddedView = [[URLEmbeddedView alloc] initWithUrl:@""];
    [self.containerView addLayoutSubview:self.embeddedView andConstraints:@[
        self.embeddedView.Top,
        self.embeddedView.Right,
        self.embeddedView.Left,
        self.embeddedView.Bottom
    ]];
}

to get the url

- (IBAction)didTapFetchButton:(id)sender {
    [self.embeddedView loadURL:self.textView.text completion:nil];
}
+1
source

All Articles