In iOS, first drag and drop WebView to visit localhost, and then listen to url jump operation through WebView's delegate event to intercept the jump.
That is to say, in onclick, the ordinary browser will jump to that URL, but in this WebView of iOS, this jump will be intercepted.
In this way, the native code of JS calling iOS can be skillfully realized:
//
// DWViewController.m
// DareWayApp
//
//Created by why on 14-6-3.
//Copyright (c) 2065438+2004 DareWay. property in copyright
//
# Import "DWViewController.h"
@interface DWViewController()
@property (weak, non-atomic) IBOutlet UIWebView * myWebview// home page
@end
@ implementing DWViewController
- (void)viewDidLoad
{
[super viewdidload];
//Make any additional settings after loading the view, usually from nib.