-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOSIABWebViewUIModel.swift
More file actions
39 lines (38 loc) · 1.9 KB
/
OSIABWebViewUIModel.swift
File metadata and controls
39 lines (38 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// Collection of properties to apply to the WebView's interface.
struct OSIABWebViewUIModel {
/// Indicates if the URL should be displayed.
let showURL: Bool
/// Indicates if the toolbar should be displayed.
let showToolbar: Bool
/// Sets the position to display the Toolbar.
let toolbarPosition: OSIABToolbarPosition
/// Indicates if the navigations should be displayed on the toolbar.
let showNavigationButtons: Bool
/// Indicates the positions of the navigation buttons and the close button - which one is on the left and on the right.
let leftToRight: Bool
/// Sets the text to display on the Close button.
let closeButtonText: String
/// Constructor method.
/// - Parameters:
/// - showURL: /// Indicates if the URL should be displayed. Defaults to `true`.
/// - showToolbar: /// Indicates if the toolbar should be displayed. Defaults to `true`.
/// - toolbarPosition: /// Sets the position to display the Toolbar. Defaults to `defaultValue`.
/// - showNavigationButtons: /// Indicates if the navigations should be displayed on the toolbar. Defaults to `true`.
/// - leftToRight: /// Indicates the positions of the navigation buttons and the close button - which one is on the left and on the right. Defaults to `false`.
/// - closeButtonText: Sets the text to display on the Close button. Defaults to `Close`.
init(
showURL: Bool = true,
showToolbar: Bool = true,
toolbarPosition: OSIABToolbarPosition = .defaultValue,
showNavigationButtons: Bool = true,
leftToRight: Bool = false,
closeButtonText: String = "Close"
) {
self.showURL = showURL
self.showToolbar = showToolbar
self.toolbarPosition = toolbarPosition
self.showNavigationButtons = showNavigationButtons
self.leftToRight = leftToRight
self.closeButtonText = closeButtonText
}
}