This repository was archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 284
Expand file tree
/
Copy pathSideMenuController+CustomTypes.swift
More file actions
75 lines (65 loc) · 2.49 KB
/
SideMenuController+CustomTypes.swift
File metadata and controls
75 lines (65 loc) · 2.49 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// SideMenuController+CustomTypes.swift
// SideMenuController
//
// Created by Teodor Patras on 15/07/16.
// Copyright © 2016 teodorpatras. All rights reserved.
//
// MARK: - Extension for implementing the custom nested types
public extension SideMenuController {
public enum SidePanelPosition {
case underCenterPanelLeft
case underCenterPanelRight
case overCenterPanelLeft
case overCenterPanelRight
var isPositionedUnder: Bool {
return self == SidePanelPosition.underCenterPanelLeft || self == SidePanelPosition.underCenterPanelRight
}
var isPositionedLeft: Bool {
return self == SidePanelPosition.underCenterPanelLeft || self == SidePanelPosition.overCenterPanelLeft
}
}
public enum StatusBarBehaviour {
case slideAnimation
case fadeAnimation
case horizontalPan
case showUnderlay
var statusBarAnimation: UIStatusBarAnimation {
switch self {
case .fadeAnimation:
return .fade
case .slideAnimation:
return .slide
default:
return .none
}
}
}
public struct Preferences {
public struct Drawing {
public var menuButtonImage: UIImage?
public var sidePanelPosition = SidePanelPosition.underCenterPanelLeft
public var sidePanelWidth: CGFloat = 300
public var centerPanelOverlayColor = UIColor(hue:0.15, saturation:0.21, brightness:0.17, alpha:0.6)
public var centerPanelShadow = false
public var sidePanelShadow = false
public var menuButtonSize = CGSize(width: 40, height: 40)
public var menuButtonSeparatorWidth = CGFloat(-10)
}
public struct Animating {
public var statusBarBehaviour = StatusBarBehaviour.slideAnimation
public var reavealDuration = 0.3
public var hideDuration = 0.2
public var transitionAnimator: TransitionAnimatable.Type? = FadeAnimator.self
}
public struct Interaction {
public var panningEnabled = true
public var swipingEnabled = true
public var menuButtonAccessibilityIdentifier: String?
}
public var drawing = Drawing()
public var animating = Animating()
public var interaction = Interaction()
public init() {}
}
}