Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kawoou committed Jan 9, 2018
2 parents f867b95 + a327b02 commit 804b9b3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions DrawerController/DrawerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ open class DrawerController: UIViewController, UIGestureRecognizerDelegate {
didSet { fadeView.backgroundColor = fadeColor }
}

@IBInspectable
public var isEnableAutoSwitchDirection: Bool = false

@IBInspectable
public var animationDuration: TimeInterval = 0.35

Expand Down Expand Up @@ -917,6 +920,17 @@ open class DrawerController: UIViewController, UIGestureRecognizerDelegate {
return percentage
}

guard ss.isEnableAutoSwitchDirection else {
switch from {
case .left:
guard percentage > 0.0 else { return 0.0 }
case .right:
guard percentage < 0.0 else { return 0.0 }
default:
return percentage
}
return percentage
}
guard ss.contentMap[to] != nil else {
return 0.0
}
Expand Down
2 changes: 1 addition & 1 deletion KWDrawerController.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'KWDrawerController'
s.version = '4.0'
s.version = '4.1'
s.summary = 'Drawer view controller that easy to use!'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.homepage = 'https://github.com/kawoou/KWDrawerController'
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ KWDrawerController is available on [CocoaPods](https://github.com/cocoapods/coco
pod 'KWDrawerController', '~> 3.7'

// Swift 4
pod 'KWDrawerController', '~> 4.0'
pod 'KWDrawerController', '~> 4.1'
```


Expand Down Expand Up @@ -236,6 +236,7 @@ Changelog
+ 3.6.1 Fixed layout issue when rotate device.
+ 3.7 Fixed not updating issues on properties.
+ 4.0 Support Swift 4.
+ 4.1 Implement new flag that enables direction auto-switching.

⚠️ Requirements
--------------
Expand Down

0 comments on commit 804b9b3

Please sign in to comment.