2018-09-26 00:56:56 +00:00
|
|
|
//
|
|
|
|
// SafariBrowserOptions.swift
|
2019-11-29 15:59:18 +00:00
|
|
|
// flutter_inappwebview
|
2018-09-26 00:56:56 +00:00
|
|
|
//
|
|
|
|
// Created by Lorenzo on 26/09/18.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2020-05-29 17:56:03 +00:00
|
|
|
@available(iOS 9.0, *)
|
2018-09-26 00:56:56 +00:00
|
|
|
@objcMembers
|
2020-05-29 17:56:03 +00:00
|
|
|
public class SafariBrowserOptions: Options<SafariViewController> {
|
2018-09-26 00:56:56 +00:00
|
|
|
|
|
|
|
var entersReaderIfAvailable = false
|
|
|
|
var barCollapsingEnabled = false
|
|
|
|
var dismissButtonStyle = 0 //done
|
|
|
|
var preferredBarTintColor = ""
|
|
|
|
var preferredControlTintColor = ""
|
2018-10-05 11:18:28 +00:00
|
|
|
var presentationStyle = 0 //fullscreen
|
|
|
|
var transitionStyle = 0 //crossDissolve
|
2018-09-26 00:56:56 +00:00
|
|
|
|
|
|
|
override init(){
|
|
|
|
super.init()
|
|
|
|
}
|
|
|
|
|
2020-05-29 17:56:03 +00:00
|
|
|
override func getRealOptions(obj: SafariViewController?) -> [String: Any?] {
|
|
|
|
var realOptions: [String: Any?] = toMap()
|
|
|
|
if let safariViewController = obj {
|
|
|
|
if #available(iOS 11.0, *) {
|
|
|
|
realOptions["entersReaderIfAvailable"] = safariViewController.configuration.entersReaderIfAvailable
|
|
|
|
realOptions["barCollapsingEnabled"] = safariViewController.configuration.barCollapsingEnabled
|
|
|
|
realOptions["dismissButtonStyle"] = safariViewController.dismissButtonStyle.rawValue
|
|
|
|
}
|
|
|
|
realOptions["presentationStyle"] = safariViewController.modalPresentationStyle.rawValue
|
|
|
|
realOptions["transitionStyle"] = safariViewController.modalTransitionStyle.rawValue
|
|
|
|
}
|
|
|
|
return realOptions
|
|
|
|
}
|
2018-09-26 00:56:56 +00:00
|
|
|
}
|