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];
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];
}
source
share