     
     override func viewDidLoad() {
         super.viewDidLoad()
+        var bottomMargin = toolbarHeight
+        if !PaymentManager.shared.isPremiumUser {
+            let bannerView = createBannerView()
+            bottomMargin += bannerView.frame.height
+            view.addSubview(bannerView)
+            bannerView.snp.makeConstraints({ make in
+                make.bottom.equalTo(view).offset(-toolbarHeight)
+                make.height.equalTo(bannerView.frame.height)
+                make.left.equalTo(view)
+                make.right.equalTo(view)
+            })
+        }
         webView = createWebView()
         view.addSubview(webView!)
-        view.autoresizesSubviews = true
-        view.autoresizingMask = [.flexibleHeight, .flexibleWidth]
-
+        webView!.snp.makeConstraints { make in
+            make.top.equalTo(view)
+            make.bottom.equalTo(view).offset(-bottomMargin)
+            make.left.equalTo(view)
+            make.right.equalTo(view)
+        }
         webView!.navigationDelegate = self
         messageHandler = MessageHandler(vc: self)
         webView!.configuration.userContentController.add(messageHandler!, name: "stickynotes")

    }
    
    fileprivate func createWebView() -> WKWebView {
        let script = WKUserScript(source: getSource(), injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false)
        let userContentController = WKUserContentController()
        userContentController.addUserScript(script)
        let configuration = WKWebViewConfiguration()
        configuration.userContentController = userContentController;
        return WKWebView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height - toolbarHeight), configuration: configuration)
    }

    func back() {

        }
    }
    var webView:          WKWebView?
    var bannerView:       GADBannerView?
    var page:             PageEntity? {
        didSet {
            mode = page == nil ? .newPage : .view
