-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOSIABOptions.swift
More file actions
30 lines (27 loc) · 1.21 KB
/
OSIABOptions.swift
File metadata and controls
30 lines (27 loc) · 1.21 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
import UIKit
/// Structure that holds the common values for SystemBrowser and WebView to use for its visual presentation.
public class OSIABOptions {
/// The view style to present.
private let viewStyle: OSIABViewStyle
/// The animation effect for the presentation appearance and dismissal.
private let animationEffect: OSIABAnimationEffect
/// Constructor method.
/// - Parameters:
/// - viewStyle: The view style to present. `defaultValue` is provided in case of no value.
/// - animationEffect: The animation effect for the presentation appearance and dismissal. `defaultValue` is provided in case of no value.
public init(viewStyle: OSIABViewStyle, animationEffect: OSIABAnimationEffect) {
self.viewStyle = viewStyle
self.animationEffect = animationEffect
}
}
// MARK: - UIKit extensions
extension OSIABOptions {
/// The `UIKit`'s `modalPresentationStyle` equivalent value.
var modalPresentationStyle: UIModalPresentationStyle {
self.viewStyle.toModalPresentationStyle()
}
/// The `UIKit`'s `modalTransitionStyle` equivalent value.
var modalTransitionStyle: UIModalTransitionStyle {
self.animationEffect.toModalTransitionStyle()
}
}