File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import UIKit
13
13
public extension RyeViewController {
14
14
func show( ) {
15
15
16
- switch self . alertType! {
16
+ switch self . alertType {
17
17
case . toast:
18
18
// create a new UIWindow
19
19
let window = UIWindow ( frame: UIScreen . main. bounds)
@@ -59,7 +59,7 @@ public extension RyeViewController {
59
59
60
60
guard let self = self else { return }
61
61
62
- switch self . alertType! {
62
+ switch self . alertType {
63
63
case . toast:
64
64
// remove the UIWindow
65
65
self . window? . isHidden = true
@@ -103,7 +103,7 @@ public extension RyeViewController {
103
103
let safeArea = getSafeAreaSpacing ( )
104
104
105
105
// update RyeView bottom constraint to position it on screen
106
- switch position! {
106
+ switch position {
107
107
case . bottom( let inset) :
108
108
return - safeArea - inset
109
109
case . top( let inset) :
@@ -137,7 +137,7 @@ public extension RyeViewController {
137
137
// update RyeView bottom constraint to position it off screen
138
138
139
139
func getRyeViewPositionConstant( ) -> CGFloat {
140
- switch position! {
140
+ switch position {
141
141
case . bottom:
142
142
return ryeView. frame. height
143
143
case . top:
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public class RyeViewController: UIViewController {
29
29
30
30
// all presentation logic is done using parentView
31
31
var parentView : UIView {
32
- switch alertType! {
32
+ switch alertType {
33
33
case . snackBar:
34
34
if var topController = UIApplication . shared. keyWindow? . rootViewController {
35
35
while let presentedViewController = topController. presentedViewController {
@@ -50,10 +50,10 @@ public class RyeViewController: UIViewController {
50
50
return keyWindow
51
51
}
52
52
}
53
- var alertType : Rye . AlertType !
54
- var viewType : Rye . ViewType !
53
+ var alertType : Rye . AlertType
54
+ var viewType : Rye . ViewType
55
55
var timeAlive : TimeInterval ?
56
- var position : Rye . Position !
56
+ var position : Rye . Position
57
57
var animationDuration : TimeInterval !
58
58
var animationType : Rye . AnimationType !
59
59
@@ -132,7 +132,7 @@ public class RyeViewController: UIViewController {
132
132
ryeView. widthAnchor. constraint ( lessThanOrEqualTo: parentView. widthAnchor, constant: - 16 ) . isActive = true
133
133
134
134
// setup constraint
135
- switch position! {
135
+ switch position {
136
136
case . bottom:
137
137
ryeViewPositionConstraint = ryeView. bottomAnchor. constraint ( equalTo: parentView. bottomAnchor)
138
138
case . top:
@@ -146,7 +146,7 @@ public class RyeViewController: UIViewController {
146
146
ryeView. layoutIfNeeded ( )
147
147
148
148
// update RyeView bottom constraint constat to position it outside of the application's UIWindow
149
- switch position! {
149
+ switch position {
150
150
case . bottom:
151
151
ryeViewPositionConstraint. constant = ryeView. frame. height
152
152
case . top:
You can’t perform that action at this time.
0 commit comments