Creating a WebView using Kotlin and Storyboard

Hi There,

I’m having trouble to create a web view screen on a Kotlin moe project.
I followed the outdated tutorial:
but without success.
Could you please tell how to create a Webview using storyboard (with proper outlet settings) then how to set an url from android studio.



After created moe “Kotlin > Single View Application”, please following steps:

  • Add the following code in the AppViewController.kt :
override fun viewDidLoad() {

        val urlString = ""
        val url = NSURL.URLWithString(urlString)
        val nsurlRequest = NSURLRequest.requestWithURL(url)

    external fun webView(): UIWebView
  • Add App Transport Security settings to info.plist :


  • Select “Multi-OS Engine Action -> Generate Actions and Outlets for Interface Builder”

  • Select “Multi-OS Engine Actions - > Open Project in Xcode”

  • Drag and Drop ‘UIWebView’ into ‘UIViewController’, and add missed constraints.

  • Open up “moe-main-interfaces.m” in the Assistant Editor and connect WebView into IBOutlet :

@property (strong) IBOutlet UIWebView* webView;
  • Close Xcode project

  • Build and run the application. You should see the content at our requested loaded into the UIWebView.

Best Regards,

1 Like


Full sample project: (67.1 KB)

1 Like

Thanks a ton Vighr!!
I will give it a try

You guys are doing a great job!! :smile:


Thanks, It works like a charm!

@vighr, Thanks for the previous sample. Do you have an another example/sample using the new WKWebView?

Ok, I found how to do it without the need of using the story board.
If you want to use the WKWebView in fullscreen, just use this very simple method into your viewDidLoad:

 private fun openWkWebView() {
    val webView = WKWebView.alloc()

    webView.setUIDelegate(object : WKUIDelegate {})// if you want more control over the UIDelegate, just override methods
    webView.setNavigationDelegate(object : WKNavigationDelegate {})// if you want more control over the NavigationDelegate, just override methods
    val urlString = ""
    // val urlString = ""
    // val urlString = ""
    val url = NSURL.URLWithString(urlString)
    val nsurlRequest = NSURLRequest.requestWithURL(url)
    webView.scrollView().setContentInsetAdjustmentBehavior(UIScrollViewContentInsetAdjustmentBehavior.Never) //remove safearea !!!

I am quite impressed with the performance of webGL examples ( on physical devices. I am sure anyone can create great apps & games quickly out these technologies :sunglasses:

Here are some screenshots taken from an iPhone 6S+ (60fps)
IMG_0656 IMG_0657 IMG_0658 IMG_0659.PNG