Skip to content

Commit d379f87

Browse files
authored
Merge pull request #49 from nodes-ios/bugFix/constraintForceUnwrap
Bug fix/constraint force unwrap
2 parents 7247798 + 31cebbc commit d379f87

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Rye.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Pod::Spec.new do |spec|
44

55
spec.name = "Rye"
66

7-
spec.version = "3.0.0"
7+
spec.version = "3.0.1"
88
spec.summary = "Rye allows you to present non intrusive alerts to your users. You can choose to display the default Rye alert or your own custom UIView."
99

1010
spec.homepage = "https://github.com/nodes-ios/Rye"

Rye/Rye/RyePresentation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ public extension RyeViewController {
131131
switch self.animationType! {
132132
case .fadeInOut:
133133
ryeView.alpha = 0
134-
ryeViewPositionConstraint.constant = ryeViewPositionConstant
134+
ryeViewPositionConstraint?.constant = ryeViewPositionConstant
135135
case .slideInOut:
136136
ryeView.alpha = 1
137-
ryeViewPositionConstraint.constant = ryeViewPositionConstant
137+
ryeViewPositionConstraint?.constant = ryeViewPositionConstant
138138
}
139139

140140
// animate
@@ -166,7 +166,7 @@ public extension RyeViewController {
166166
case .fadeInOut:
167167
break
168168
case .slideInOut:
169-
ryeViewPositionConstraint.constant = getRyeViewPositionConstant()
169+
ryeViewPositionConstraint?.constant = getRyeViewPositionConstant()
170170
}
171171

172172
// animate

Rye/Rye/RyeViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class RyeViewController: UIViewController {
4646

4747
// MARK: - Rye View Properties
4848

49-
var ryeViewPositionConstraint: NSLayoutConstraint!
49+
var ryeViewPositionConstraint: NSLayoutConstraint?
5050

5151
// MARK: - Init
5252

@@ -155,7 +155,7 @@ public class RyeViewController: UIViewController {
155155
ryeViewPositionConstraint = ryeView.topAnchor.constraint(equalTo: parentView.topAnchor)
156156
}
157157

158-
ryeViewPositionConstraint.isActive = true
158+
ryeViewPositionConstraint?.isActive = true
159159

160160
// force RyeView to layout so it calculates it's frames
161161
ryeView.setNeedsLayout()
@@ -164,9 +164,9 @@ public class RyeViewController: UIViewController {
164164
// update RyeView bottom constraint constat to position it outside of the application's UIWindow
165165
switch position {
166166
case .bottom:
167-
ryeViewPositionConstraint.constant = ryeView.frame.height
167+
ryeViewPositionConstraint?.constant = ryeView.frame.height
168168
case .top:
169-
ryeViewPositionConstraint.constant = -ryeView.frame.height
169+
ryeViewPositionConstraint?.constant = -ryeView.frame.height
170170
}
171171
}
172172

0 commit comments

Comments
 (0)