-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOSIABAnimationEffect.swift
More file actions
28 lines (23 loc) · 950 Bytes
/
OSIABAnimationEffect.swift
File metadata and controls
28 lines (23 loc) · 950 Bytes
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
import UIKit
/// Enumerator that holds all possible values for the Animation Effect.
public enum OSIABAnimationEffect: String {
case coverVertical = "COVER_VERTICAL"
case crossDissolve = "CROSS_DISSOLVE"
case flipHorizontal = "FLIP_HORIZONTAL"
/// Default value to consider in the absence of value.
public static let defaultValue: Self = .coverVertical
}
// MARK: - UIKit Mapping Method
extension OSIABAnimationEffect {
/// Converts the current value to `UIKit`'s `UIModalTransitionStyle` equivalent.
/// - Returns: `UIKit`'s `UIModalTransitionStyle` equivalent value.
func toModalTransitionStyle() -> UIModalTransitionStyle {
let result: UIModalTransitionStyle
switch self {
case .coverVertical: result = .coverVertical
case .crossDissolve: result = .crossDissolve
case .flipHorizontal: result = .flipHorizontal
}
return result
}
}