WebView history

I want to have all the history (all visited website) shown in a table view or anything else. How can I do please ?

Accepted Reply

It's an introductory level programming assignment.


Edit: I posted a link to some old documentation. I'm pretty sure the basic walk through of how to use the WK WebKit classes has been covered in recent WWDC video sessions. That would be where to start if you need a walk through.

Replies

Thank you for your answer! I've created a tableview on the view controller web just to see if It works.

I use this to show the navigation history :

@interface ViewControllerWeb () <UITableViewDelegate,UITableViewDataSource,WKNavigationDelegate,WKUIDelegate>
@property(nonatomic,readonly,copy) NSArray<WKBackforwardlistItem*> *backlist;
implementation Viewcontrollerweb {
     NSArray *webhistory;
}
-(void)viewDidload {
     [super viewDidLoad]
webhistory = [NSArray arraywitharray:_backlist];

and this :

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [webhistory count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"SimpleTableItem";
  
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
    }
  
    cell.textLabel.text = [webhistory objectAtIndex:indexPath.row];
    return cell;
}

But I don't see anything on the table view . Maybe my codes are wrong ?

an 23, 2017 2:17 PM (in response to NotMyName) Thank you for you response . I have a problem , I cannot perform a void for the WKWebview @interface ViewControllerWeb () @property(strong,nonatomic) WKWebView *webView; .... - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { NSLog(@"success"); } - (void)viewDidLoad { [super viewDidLoad]; _webView.navigationDelegate = self; _webView = [[WKWebView alloc] initWithFrame:self.view.frame]; _webView.frame = CGRectMake(self.view.frame.origin.x,self.view.frame.origin.y +69, self.view.frame.size.width, self.view.frame.size.height -108); [self.view addSubview:_webView]; } : It doesn't work

You may have more luck attracting a response if you format your code as code. You can do this using the

<>
icon in the editor.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"