Commit f42f9356 by Daniel Dahan

development: removed non-optional checks in a guard statement

parent e773c782
...@@ -25,9 +25,9 @@ The first version of Material was to bring Material Design to iOS. We considered ...@@ -25,9 +25,9 @@ The first version of Material was to bring Material Design to iOS. We considered
- [x] TabBar - [x] TabBar
- [x] PageTabBar - [x] PageTabBar
- [X] SearchBar - [X] SearchBar
- [x] NavigationBar - [x] NavigationController
- [x] BottomNavigationBar
- [x] NavigationDrawer - [x] NavigationDrawer
- [x] BottomNavigationBar
- [x] Example Projects - [x] Example Projects
- [x] And More... - [x] And More...
......
...@@ -395,10 +395,8 @@ open class Switch: UIControl { ...@@ -395,10 +395,8 @@ open class Switch: UIControl {
return return
} }
guard let q: CGFloat = max(min(sender.x + v.location(in: sender).x - v.previousLocation(in: sender).x, onPosition), offPosition) else { let q: CGFloat = max(min(sender.x + v.location(in: sender).x - v.previousLocation(in: sender).x, onPosition), offPosition)
return
}
guard q != sender.x else { guard q != sender.x else {
return return
} }
...@@ -432,7 +430,7 @@ open class Switch: UIControl { ...@@ -432,7 +430,7 @@ open class Switch: UIControl {
/// Reloads the view. /// Reloads the view.
open func reload() { open func reload() {
var w: CGFloat = intrinsicContentSize.width let w: CGFloat = intrinsicContentSize.width
let px: CGFloat = (width - w) / 2 let px: CGFloat = (width - w) / 2
track.frame = CGRect(x: px, y: (height - trackThickness) / 2, width: w, height: trackThickness) track.frame = CGRect(x: px, y: (height - trackThickness) / 2, width: w, height: trackThickness)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment