iosWebViewFix/macos/Classes/InAppBrowser/InAppBrowserSettings.swift

36 lines
1.2 KiB
Swift
Raw Normal View History

2022-10-17 00:23:05 +00:00
//
// InAppBrowserOptions.swift
// flutter_inappwebview
//
// Created by Lorenzo on 17/09/18.
//
import Foundation
@objcMembers
public class InAppBrowserSettings: ISettings<InAppBrowserWebViewController> {
var hidden = false
var hideToolbarTop = true
var toolbarTopBackgroundColor: String?
var hideUrlBar = false
var hideProgressBar = false
var toolbarTopFixedTitle: String?
2022-10-17 00:23:05 +00:00
override init(){
super.init()
}
override func getRealSettings(obj: InAppBrowserWebViewController?) -> [String: Any?] {
var realOptions: [String: Any?] = toMap()
if let inAppBrowserWebViewController = obj {
realOptions["hidden"] = inAppBrowserWebViewController.isHidden
2022-10-17 00:23:05 +00:00
realOptions["hideUrlBar"] = inAppBrowserWebViewController.window?.searchBar?.isHidden
realOptions["hideProgressBar"] = inAppBrowserWebViewController.progressBar.isHidden
2022-10-17 00:23:05 +00:00
realOptions["hideToolbarTop"] = !(inAppBrowserWebViewController.window?.toolbar?.isVisible ?? true)
realOptions["toolbarTopBackgroundColor"] = inAppBrowserWebViewController.window?.backgroundColor.hexString
2022-10-17 00:23:05 +00:00
}
return realOptions
}
}